-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.06 KB
/
cpp-linter.yaml
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
62
63
64
65
66
67
68
69
70
71
name: cpp-linter
permissions:
checks: write
pull-requests: write
repository-projects: write
on:
push:
paths:
- "src/**"
- "!**.qml"
- "!**.md"
- "!**.cmake"
pull_request:
paths:
- "src/**"
- "!**.qml"
- "!**.md"
- "!**.cmake"
env:
BUILD_TYPE: Release
jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@v1.1
with:
version: '1.11.1'
# https://github.com/zhuzichu520/FluentUI/blob/06c9b4e3829af636234a98f946603d68c23f6459/.github/workflows/ubuntu.yml#L49-L50
- name: Install GL library (Ubuntu)
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
modules: 'qt5compat qtwebsockets qthttpserver qtshadertools'
cache: 'true'
cache-key-prefix: 'install-qt-action'
- name: Configure CMake
run: cmake -G Ninja -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_PREFIX_PATH=${{env.Qt6_DIR}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: '16'
style: file
database: ${{github.workspace}}/build
tidy-checks: -modernize-use-trailing-return-type,-readability-avoid-const-params-in-decls
file-annotations: false
step-summary: true
thread-comments: ${{ github.event_name == 'pull_request' }}
lines-changed-only: false
files-changed-only: true
- name: Failed if needed
if: steps.linter.outputs.checks-failed > 0
run: exit 1