@@ -15,24 +15,29 @@ jobs:
15
15
runs-on : ubuntu-22.04
16
16
steps :
17
17
- name : Checkout PR branch
18
- uses : actions/checkout@v3
18
+ uses : actions/checkout@v4
19
19
with :
20
20
ref : ${{ github.event.pull_request.head.sha }}
21
21
fetch-depth : 0
22
+
22
23
- name : Setup Python
23
- uses : actions/setup-python@v4
24
+ uses : actions/setup-python@v5
24
25
with :
25
- python-version : 3.7
26
+ python-version : 3.10
27
+
26
28
- name : Install clang-format
27
29
run : |
28
30
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
30
33
sudo apt update
31
- sudo apt install -y clang-format-15
34
+ sudo apt install -y clang-format-18
35
+
32
36
- name : Download git-clang-format
33
37
run : |
34
38
wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/git-clang-format
35
39
chmod +x git-clang-format
40
+
36
41
- name : Run git-clang-format
37
42
run : |
38
43
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:
41
46
-c color.ui=always \
42
47
-c diff.wsErrorHighlight=all \
43
48
-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/ || \
45
50
(echo "Please run the following git-clang-format locally to fix the formatting: \n
46
51
git-clang-format HEAD~\n
47
52
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
49
54
\t\t Then inspect the results with: git log --oneline\n
50
55
\t\t Then squash without poluting the history with: git rebase --autosquash -i main\n" && exit 1)
0 commit comments