forked from cda-tum/mqt-qmap
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.24 KB
/
cpp-linter.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
name: cpp-linter
on:
pull_request:
merge_group:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
Z3_VERSION: 4.11.2
jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Z3
uses: cda-tum/setup-z3@v1
with:
version: ${{ env.Z3_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate compilation database
run: |
CC=clang-14 CXX=clang++-14 \
cmake -S . -B build \
-DBINDINGS=ON \
-DBUILD_QMAP_TESTS=ON
- name: Run cpp-linter
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pipx run cpp-linter \
--version=14 \
--style="file" \
--tidy-checks="" \
--thread-comments=true \
--files-changed-only=true \
--ignore="build" \
--database=build
- name: Fail if linter found errors
if: steps.linter.outputs.checks-failed > 0
run: echo "Linter found errors" && exit 1