Skip to content

Commit 843deeb

Browse files
committed
Update CI workflows
1 parent a6e74c0 commit 843deeb

6 files changed

Lines changed: 91 additions & 161 deletions

File tree

.clang-tidy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Checks: "bugprone-*,
5353
-*-pro-bounds-avoid-unchecked-container-access,
5454
-*-unnecessary-value-param"
5555
WarningsAsErrors: "*"
56-
HeaderFilterRegex: '$^'
56+
HeaderFilterRegex: 'src/.*'
5757
ExcludeHeaderFilterRegex: '(^|.*/)(maszyna|gen|godot-cpp)/'
5858
RemovedArgs:
5959
- '-fno-gnu-unique'
@@ -119,4 +119,4 @@ CheckOptions:
119119
- key: readability-identifier-naming.MacroDefinitionCase
120120
value: 'UPPER_CASE'
121121
- key: readability-identifier-naming.IgnoredMacros
122-
value: 'GDCLASS;VARIANT_ENUM_CAST'
122+
value: 'GDCLASS;VARIANT_ENUM_CAST;ERR_FAIL_NULL_V;ERR_FAIL_COND_V_MSG;ERR_FAIL_COND_MSG'

.github/workflows/build.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
matrix:
1111
arch: [x86_64]
1212
target: [template_debug]
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4.2.2
16+
uses: actions/checkout@v6
1717
with:
1818
submodules: recursive
1919

20-
- uses: actions/cache/restore@v4.2.3
20+
- uses: actions/cache/restore@v5
2121
id: cache-restore
2222
with:
2323
path: |
@@ -33,17 +33,17 @@ jobs:
3333
run: sudo chmod 777 ci/docker/entrypoint.sh |
3434
docker compose run windows_${{ matrix.arch }} ${{ matrix.target }}
3535

36-
- uses: actions/upload-artifact@v4.6.2
36+
- uses: actions/upload-artifact@v7
3737
with:
3838
name: lib-windows-${{ matrix.target }}-${{ matrix.arch }}
3939
path: demo/bin/libmaszyna/windows
4040

41-
- uses: actions/upload-artifact@v4.6.2
41+
- uses: actions/upload-artifact@v7
4242
with:
4343
name: game-windows-${{ matrix.target }}-${{ matrix.arch }}
4444
path: build/windows
4545

46-
- uses: actions/cache/save@v4.2.3
46+
- uses: actions/cache/save@v5
4747
id: cache
4848
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
4949
with:
@@ -61,11 +61,11 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- name: Checkout
64-
uses: actions/checkout@v4.2.2
64+
uses: actions/checkout@v6
6565
with:
6666
submodules: recursive
6767

68-
- uses: actions/cache/restore@v4.2.3
68+
- uses: actions/cache/restore@v5
6969
id: cache-restore
7070
with:
7171
path: |
@@ -81,17 +81,17 @@ jobs:
8181
run: sudo chmod 777 ci/docker/entrypoint.sh |
8282
docker compose run linux_${{ matrix.arch }} ${{ matrix.target }}
8383

84-
- uses: actions/upload-artifact@v4.6.2
84+
- uses: actions/upload-artifact@v7
8585
with:
8686
name: lib-linux-${{ matrix.target }}-${{ matrix.arch }}
8787
path: demo/bin/libmaszyna/linux
8888

89-
- uses: actions/upload-artifact@v4.6.2
89+
- uses: actions/upload-artifact@v7
9090
with:
9191
name: game-linux-${{ matrix.target }}-${{ matrix.arch }}
9292
path: build/linux
9393

94-
- uses: actions/cache/save@v4.2.3
94+
- uses: actions/cache/save@v5
9595
id: cache
9696
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
9797
with:
@@ -109,11 +109,11 @@ jobs:
109109
runs-on: ubuntu-latest
110110
steps:
111111
- name: Checkout
112-
uses: actions/checkout@v4.2.2
112+
uses: actions/checkout@v6
113113
with:
114114
submodules: recursive
115115

116-
- uses: actions/cache/restore@v4.2.3
116+
- uses: actions/cache/restore@v5
117117
id: cache-restore
118118
with:
119119
path: |
@@ -129,17 +129,17 @@ jobs:
129129
run: sudo chmod 777 ci/docker/entrypoint.sh |
130130
docker compose run android_${{ matrix.arch }} ${{ matrix.target }}
131131

132-
- uses: actions/upload-artifact@v4.6.2
132+
- uses: actions/upload-artifact@v7
133133
with:
134134
name: lib-android-${{ matrix.target }}-${{ matrix.arch }}
135135
path: demo/bin/libmaszyna/android
136136

137-
- uses: actions/upload-artifact@v4.6.2
137+
- uses: actions/upload-artifact@v7
138138
with:
139139
name: game-android-${{ matrix.target }}-${{ matrix.arch }}
140140
path: build/android
141141

142-
- uses: actions/cache/save@v4.2.3
142+
- uses: actions/cache/save@v5
143143
id: cache
144144
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
145145
with:

.github/workflows/clang-tidy.yml

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: clang-tidy
1+
name: style-check
22

33
on:
4-
push:
54
pull_request:
5+
workflow_dispatch:
6+
7+
env:
8+
LLVM_VERSION: 22.1.4
69

710
jobs:
811
clang-tidy:
9-
name: Run clang-tidy and upload report
10-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1113
steps:
1214
- name: Checkout repository
1315
uses: actions/checkout@v6.0.0
@@ -20,95 +22,90 @@ jobs:
2022
with:
2123
python-version: '3.x'
2224

23-
- name: Install LLVM (clang/clang-tidy) with cache
24-
uses: KyleMayes/install-llvm-action@v2.0.9
25+
- name: Cache LLVM
26+
id: cache-llvm
27+
uses: actions/cache@v5
2528
with:
26-
version: "21"
29+
path: LLVM-${{ env.LLVM_VERSION }}-Linux-X64.tar.xz
30+
key: ${{ runner.os }}-llvm-${{ env.LLVM_VERSION }}
2731

28-
- name: Generate CMakeLists.txt via helper script
32+
- name: Install LLVM (clang/clang-tidy/clang-format) and dependencies
2933
run: |
30-
# Run from ci/docker so the script writes to ../../CMakeLists.txt (project root)
31-
sudo chmod +x ./ci/generate_cmakelists.sh
32-
cd ci/
33-
./generate_cmakelists.sh
34+
sudo apt update
35+
sudo add-apt-repository universe
36+
sudo apt update
37+
sudo apt install libncurses5-dev ripgrep
38+
if [ "${{ steps.cache-llvm.outputs.cache-hit }}" != "true" ]; then
39+
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.LLVM_VERSION }}/LLVM-${{ env.LLVM_VERSION }}-Linux-X64.tar.xz
40+
fi
41+
sudo tar -xf LLVM-${{ env.LLVM_VERSION }}-Linux-X64.tar.xz
42+
sudo mv LLVM-${{ env.LLVM_VERSION }}-Linux-X64 /usr/local/llvm-${{ env.LLVM_VERSION }}
43+
sudo ln -s /usr/local/llvm-${{ env.LLVM_VERSION }}/bin/clang-tidy /usr/local/bin/clang-tidy
44+
sudo ln -s /usr/local/llvm-${{ env.LLVM_VERSION }}/bin/run-clang-tidy /usr/local/bin/run-clang-tidy
45+
sudo ln -s /usr/local/llvm-${{ env.LLVM_VERSION }}/bin/clang-format /usr/local/bin/clang-format
3446
35-
- name: Configure CMake and generate compile_commands.json
36-
run: |
37-
cmake -S . -B build -DCODECHECK_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
38-
python ci/filter-cc.py
39-
- name: Run clang-tidy
47+
- name: Run style-check
4048
id: run
4149
shell: bash
4250
run: |
43-
sudo apt update
44-
sudo add-apt-repository universe
45-
sudo apt update
46-
sudo apt install libncurses5-dev libtinfo5
4751
set -o pipefail
48-
# Collect sources (mirror Makefile exclusions)
49-
mapfile -t FILES < <(find src/ \( -name "*.cpp" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cxx" -o -name "*.c" -o -name "*.h" \) \
50-
-not -path "src/maszyna/*" -not -path "src/gen/*" -not -path "godot-cpp")
51-
52-
echo "Running clang-tidy on ${#FILES[@]} files"
52+
: > style-check.log
53+
54+
# make style-check handles CMake configuration if needed
55+
make style-check 2>&1 | tee style-check.log
5356
54-
: > clang-tidy.log
55-
: > clang-tidy-errors.log
56-
57-
# Run clang-tidy for each file, appending to a single log
58-
for f in "${FILES[@]}"; do
59-
echo "=== ${f} ===" | tee -a clang-tidy.log
60-
# Use project-local .clang-tidy implicitly
61-
if ! sudo clang-tidy -p build -extra-arg=-std=c++17 --quiet --fix-notes -header-filter=^src/ "$f" 2>>clang-tidy-errors.log | tee -a clang-tidy.log; then
62-
echo "clang-tidy reported non-zero status for $f" >> clang-tidy-errors.log
63-
fi
64-
done
65-
66-
# Save a simple status for later steps
67-
issues=$(grep -E "^[^=][^=]*:[0-9]+:[0-9]+: (warning|error): .* \[[^]]+\]" clang-tidy.log | grep -v -E "godot[-_]?cpp" | wc -l || true)
57+
issues=$(grep -E "^[^=][^=]*:[0-9]+:[0-9]+: (warning|error): .* \[[^]]+\]" style-check.log | grep -v -E "godot[-_]?cpp" | wc -l || true)
6858
echo "issues=$issues" >> $GITHUB_OUTPUT
6959
7060
- name: Build Markdown table report
61+
if: always()
7162
run: |
7263
{
73-
echo "# Clang-Tidy Report"
64+
echo "# Style Check Report"
7465
echo
7566
echo "Generated on: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
7667
echo
77-
echo "Configuration: .clang-tidy"
78-
echo
79-
echo "Total issues: ${{ steps.run.outputs.issues }}"
68+
echo "Total issues found: ${{ steps.run.outputs.issues }}"
8069
echo
70+
71+
if grep -q "clang-format" style-check.log; then
72+
echo "## Clang-Format Issues"
73+
echo '```'
74+
grep "clang-format" style-check.log || echo "No clang-format issues"
75+
echo '```'
76+
echo
77+
fi
78+
79+
echo "## Clang-Tidy Issues"
8180
echo "| File | Line | Column | Severity | Check | Message |"
8281
echo "|------|------|--------|----------|-------|---------|"
8382
# Parse lines like: path:line:col: severity: message [check]
84-
# Exclude any header lines (like === file ===)
85-
grep -E "^[^=][^=]*:[0-9]+:[0-9]+: (warning|error): .* \[[^]]+\]" clang-tidy.log | \
83+
grep -E "^[^=][^=]*:[0-9]+:[0-9]+: (warning|error): .* \[[^]]+\]" style-check.log | \
8684
grep -v -E "godot[-_]?cpp" | \
8785
awk '
8886
function html_escape(s){gsub(/\|/ ,"\\|", s); gsub(/\\\\/ ,"\\\\\\\\", s); return s}
8987
{
9088
match($0, /^([^:]+):([0-9]+):([0-9]+): ([a-z]+): (.*) \[([^\]]+)\]$/, m)
9189
if (m[0] != "") {
9290
file=m[1]; line=m[2]; col=m[3]; sev=m[4]; msg=m[5]; chk=m[6]
93-
# Escape vertical bars to keep markdown table intact
9491
gsub(/\|/, "\\|", file)
9592
gsub(/\|/, "\\|", msg)
9693
printf("| %s | %s | %s | %s | %s | %s |\n", file, line, col, sev, chk, msg)
9794
}
9895
}
9996
'
10097
echo
101-
echo "\n<details><summary>Raw clang-tidy log</summary>\n\n\n````\n"
102-
sed 's/`/\x60/g' clang-tidy.log
103-
echo "\n````\n\n</details>"
104-
} > clang-tidy-report.md
98+
echo -e "\n<details><summary>Raw style-check log</summary>\n\n\n\`\`\`\n"
99+
sed 's/`/\x60/g' style-check.log
100+
echo -e "\n\`\`\`\n\n</details>"
101+
} > style-check-report.md
105102
106103
- name: Post annotations to GitHub
107104
if: always()
108105
run: |
109106
# Parse clang-tidy log and create GitHub annotations
110-
grep -E "^[^=][^=]*:[0-9]+:[0-9]+: (warning|error): .* \[[^]]+\]" clang-tidy.log | \
111-
grep -v -E "godot[-_]?cpp" | \
107+
grep -E ": (warning|error): .* \[[^]]+\]" style-check.log | \
108+
grep -v -E "godot[-_]?cpp|src/maszyna|src/gen" | \
112109
awk '
113110
function esc(s) {
114111
gsub(/%/, "%25", s); gsub(/\r/, "%0D", s); gsub(/\n/, "%0A", s);
@@ -119,23 +116,24 @@ jobs:
119116
if (m[0] != "") {
120117
file=m[1]; line=m[2]; col=m[3]; sev=m[4]; msg=m[5]; chk=m[6]
121118
level="warning"
119+
if (sev == "error") level="error"
122120
printf("::%s file=%s,line=%s,col=%s,title=clang-tidy (%s)::%s\n",
123121
level, file, line, col, chk, esc(msg))
124122
}
125123
}'
126124
127125
- name: Upload artifact
126+
if: always()
128127
uses: actions/upload-artifact@v7.0.0
129128
with:
130-
name: clang-tidy-report
129+
name: style-check-report
131130
path: |
132-
clang-tidy.log
133-
clang-tidy-errors.log
134-
clang-tidy-report.md
131+
style-check.log
132+
style-check-report.md
135133
if-no-files-found: warn
136134

137135
- name: Fail on issues
138136
if: ${{ steps.run.outputs.issues != '0' }}
139137
run: |
140-
echo "clang-tidy found ${{ steps.run.outputs.issues }} issue(s). See artifact for details." >&2
138+
echo "Style check found ${{ steps.run.outputs.issues }} issue(s). See artifact for details." >&2
141139
exit 1

.github/workflows/tests.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
1-
name: Run Godot Tests
1+
name: godot-unit-tests
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
workflow_dispatch:
46

57
jobs:
68
run-tests:
7-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04
810

911
steps:
1012
- name: Check out the code
11-
uses: actions/checkout@v4.2.2
13+
uses: actions/checkout@v6
1214
with:
1315
submodules: recursive
1416

15-
- uses: actions/cache/restore@v4.2.3
17+
- uses: actions/cache/restore@v5
1618
id: cache-restore
1719
with:
1820
path: |
1921
godot-cpp/
22+
build-host/
23+
build-linux64/
2024
.sconsign.dblite
21-
key: godot-unit-tests
25+
key: ${{ runner.os }}-unit-tests-host-template_debug
2226
restore-keys: |
23-
godot-unit-tests
24-
godot-unit-
27+
${{ runner.os }}-unit-tests-host-
28+
${{ runner.os }}-unit-tests-
2529
- name: Run tests
2630
run: sudo chmod 777 ci/docker/entrypoint.sh |
2731
docker compose run unit_tests
28-
- uses: actions/upload-artifact@v4.6.2
32+
- uses: actions/upload-artifact@v7
2933
with:
3034
name: gut-test-results
3135
path: demo/test_results.xml
32-
- uses: actions/cache/save@v4.2.3
36+
- uses: actions/cache/save@v5
3337
id: cache
3438
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
3539
with:
3640
path: |
3741
godot-cpp/
42+
build-host/
43+
build-linux64/
3844
.sconsign.dblite
39-
key: godot-unit-tests
45+
key: ${{ runner.os }}-unit-tests-host-template_debug

ci/filter-cc.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)