-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (54 loc) · 1.99 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Lint CI
on:
push:
branches: ['main']
pull_request:
workflow_dispatch:
jobs:
cpp-linter:
name: C++ lints(clang-format + clang-tidy)
runs-on: ubuntu-24.04
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
- name: Setup Meson
run: |
pip install meson --break-system-packages
- name: Setup Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
echo "CC=clang-19" >> "$GITHUB_ENV"
echo "CXX=clang++-19" >> "$GITHUB_ENV"
echo "OBJC=clang-19" >> "$GITHUB_ENV"
- name: Prepare compile_commands.json
run: |
sudo apt-get update
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* desktop-file-utils -y --no-install-recommends
meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true
meson compile -C build git_version.hpp
- uses: cpp-linter/cpp-linter-action@v2
id: linter
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
version: 19
database: build
files-changed-only: ${{ github.event_name != 'workflow_dispatch' }}
lines-changed-only: ${{ github.event_name != 'workflow_dispatch' }}
thread-comments: update
tidy-checks: ''
step-summary: true
file-annotations: true
ignore: subprojects|build|android|assets|recordings|docs|toolchains|platforms|wrapper|src/libs/core/hash-library|tests|src/lobby/curl_client.*
- name: Fail CI run if linter checks failed
if: steps.linter.outputs.checks-failed != 0
run: |
echo "${{ steps.linter.outputs.checks-failed }} linter checks failed"
exit 1