-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (64 loc) · 1.74 KB
/
cpp.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: C++
# spell-checker:ignore DCMAKE
on:
push:
branches: ["main"]
paths:
- 'bindings/cpp/**'
- 'CMakeLists.txt'
- 'crates/**'
- 'Cargo.*'
pull_request:
branches: ["main"]
paths:
- 'bindings/cpp/**'
- 'CMakeLists.txt'
- 'crates/**'
- 'Cargo.*'
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- name: Generate oxidd/capi.h
working-directory: build
run: make oxidd-capi-header
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 18
ignore: "|!bindings/cpp"
database: "build/compile_commands.json"
style: "file" # Use .clang-format config file
tidy-checks: "" # Use .clang-tidy config file
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- { cc: "gcc", cxx: "g++" }
- { cc: "clang", cxx: "clang++" }
steps:
- uses: actions/checkout@v4
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
- name: Build
working-directory: build
run: make boolean-function
- name: Run Tests
working-directory: build
run: make test