Skip to content

Commit ef7991d

Browse files
committed
Run the clang-format Github action on ubuntu-latest
- Use latest actions versions
1 parent fc7cbaa commit ef7991d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/clang-format.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@ on: [push, pull_request]
44

55
jobs:
66
check:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
env:
9-
CLANG_VERSION: 10
9+
CLANG_VERSION: 21
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v6.0.1
1212
- name: Install clang-format
1313
run: |
14+
if [[ type -p clang-format ]]
15+
then
16+
exit 0
17+
fi
18+
1419
codename=$( lsb_release --codename --short )
1520
sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null <<EOF
21+
deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename} main
22+
deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename} main
1623
deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
1724
deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
1825
EOF
@@ -28,7 +35,7 @@ jobs:
2835
git diff --exit-code | tee "clang-format.patch"
2936
- name: Upload patch
3037
if: failure() && steps.assert.outcome == 'failure'
31-
uses: actions/upload-artifact@v2
38+
uses: actions/upload-artifact@v6.0.0
3239
continue-on-error: true
3340
with:
3441
name: clang-format.patch

0 commit comments

Comments
 (0)