@@ -15,24 +15,29 @@ jobs:
1515 runs-on : ubuntu-22.04
1616 steps :
1717 - name : Checkout PR branch
18- uses : actions/checkout@v3
18+ uses : actions/checkout@v4
1919 with :
2020 ref : ${{ github.event.pull_request.head.sha }}
2121 fetch-depth : 0
22+
2223 - name : Setup Python
23- uses : actions/setup-python@v4
24+ uses : actions/setup-python@v5
2425 with :
25- python-version : 3.7
26+ python-version : 3.10
27+
2628 - name : Install clang-format
2729 run : |
2830 curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
29- echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee -a /etc/apt/sources.list
31+ os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`"
32+ echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-18 main" | sudo tee -a /etc/apt/sources.list
3033 sudo apt update
31- sudo apt install -y clang-format-15
34+ sudo apt install -y clang-format-18
35+
3236 - name : Download git-clang-format
3337 run : |
3438 wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/git-clang-format
3539 chmod +x git-clang-format
40+
3641 - name : Run git-clang-format
3742 run : |
3843 PR_BASE=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1)
@@ -41,10 +46,10 @@ jobs:
4146 -c color.ui=always \
4247 -c diff.wsErrorHighlight=all \
4348 -c color.diff.whitespace='red reverse' \
44- clang-format-15 --diff --binary clang-format-15 --commit $PR_BASE -- include/ lib/ || \
49+ clang-format-18 --diff --binary clang-format-18 --commit $PR_BASE -- include/ lib/ || \
4550 (echo "Please run the following git-clang-format locally to fix the formatting: \n
4651 git-clang-format HEAD~\n
4752 for multiple commits we should place the formatting changes in the related commit with:\n
48- \t\tgit rebase -i -x \"git-clang-format-15 main && git commit -a --allow-empty --fixup=HEAD\" --strategy-option=theirs origin/main\n
53+ \t\tgit rebase -i -x \"git-clang-format-18 main && git commit -a --allow-empty --fixup=HEAD\" --strategy-option=theirs origin/main\n
4954 \t\t Then inspect the results with: git log --oneline\n
5055 \t\t Then squash without poluting the history with: git rebase --autosquash -i main\n" && exit 1)
0 commit comments