Skip to content

Commit b2f2c39

Browse files
authored
Merge pull request #158 from sysprog21/ci-bump
Bump CI dependencies and use clang-format-20
2 parents f79b276 + 42b0f4d commit b2f2c39

4 files changed

Lines changed: 19 additions & 17 deletions

File tree

.ci/check-format.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
set -e -u -o pipefail
44

5-
SOURCES=$(find $(git rev-parse --show-toplevel) | egrep "\.(c|cxx|cpp|h|hpp)\$")
5+
cd "$(git rev-parse --show-toplevel)"
66

7-
set -x
7+
FAIL=0
8+
while IFS= read -r -d '' file; do
9+
if ! clang-format-20 -- "${file}" | diff -u -p --label="${file}" --label="expected coding style" "${file}" -; then
10+
FAIL=1
11+
fi
12+
done < <(git ls-files -z '*.c' '*.h' '*.cxx' '*.cpp' '*.hpp')
813

9-
for file in ${SOURCES};
10-
do
11-
clang-format-18 ${file} > expected-format
12-
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
13-
done
14-
exit $(clang-format-18 --output-replacements-xml ${SOURCES} | egrep -c "</replacement>")
14+
exit ${FAIL}

.github/workflows/headless-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-24.04
88

99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111

1212
- name: Install dependencies
1313
run: |

.github/workflows/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
has_code_related_changes: ${{ steps.set_has_code_related_changes.outputs.has_code_related_changes }}
1010
steps:
1111
- name: Check out the repository
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
1313
- name: Test changed files
1414
id: changed-files
15-
uses: tj-actions/changed-files@v45
15+
uses: tj-actions/changed-files@v47
1616
with:
1717
files: |
1818
.ci/**
@@ -38,12 +38,11 @@ jobs:
3838
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
3939
runs-on: ubuntu-24.04
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@v6
4242
- name: install-dependencies
4343
run: |
4444
sudo apt-get update -q -y
45-
sudo apt install libsdl2-dev libjpeg-dev libpng-dev
46-
sudo apt install libcairo2-dev
45+
sudo apt-get install -y libsdl2-dev libjpeg-dev libpng-dev libcairo2-dev
4746
shell: bash
4847
- name: default build
4948
run: |
@@ -55,10 +54,13 @@ jobs:
5554
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
5655
runs-on: ubuntu-24.04
5756
steps:
58-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@v6
5958
- name: coding convention
6059
run: |
61-
sudo apt-get install -q -y clang-format-18
60+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
61+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null
62+
sudo apt-get update -q -y
63+
sudo apt-get install -q -y clang-format-20
6264
.ci/check-newline.sh
6365
.ci/check-format.sh
6466
shell: bash

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ However, participation requires adherence to fundamental ground rules:
4444
This variant should be considered the standard for all documentation efforts.
4545
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".
4646

47-
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
47+
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 20 or later.
4848

4949
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones.
5050
For maintaining a uniform coding style, execute the command `clang-format -i *.[ch]`.

0 commit comments

Comments
 (0)