Skip to content

Commit

Permalink
use clang-format-18 in ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
craffael committed Aug 19, 2024
1 parent 2639fe2 commit 50bd41f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defaults:

jobs:
clang-format:
name: clang-format-17
name: clang-format-18
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand All @@ -25,8 +25,8 @@ jobs:
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - &&
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" &&
sudo apt-get install clang-format-17
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" &&
sudo apt-get install clang-format-18
- name: clang-format
run: "./ci/run-clang-format.py -r --clang-format-executable clang-format-17 --color always ./lib/ ./projects/ ./examples/"
clang-tidy:
Expand Down
10 changes: 5 additions & 5 deletions run_clang_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
if [ -x "$(command -v clang-format)" ]; then
ct=$(command -v clang-format)
fi
if [ -x "$(command -v clang-format-17)" ]; then
ct=$(command -v clang-format-17)
if [ -x "$(command -v clang-format-18)" ]; then
ct=$(command -v clang-format-18)
fi

if [ -z "$ct" ]; then
echo "clang-format or clang-format-17 not found in path"
echo "clang-format or clang-format-18 not found in path"
exit 1
fi
version=$($ct --version)
if [[ ! $version =~ "version 17." ]]; then
echo "ERROR: Found clang-format but it doesn't have version 17.x. Please install clang-format-17"
if [[ ! $version =~ "version 18." ]]; then
echo "ERROR: Found clang-format but it doesn't have version 18.x. Please install clang-format-18"
exit 1
fi
echo "using $ct"
Expand Down

0 comments on commit 50bd41f

Please sign in to comment.