-
-
Notifications
You must be signed in to change notification settings - Fork 2
165 lines (157 loc) · 5.56 KB
/
build_and_test.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Build and test
on:
push:
branches:
- 'master'
pull_request:
permissions:
contents: read
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
static-analysis:
runs-on: ubuntu-latest
container: egecetinn/alpine
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Run clang-format
run: clang-format include/**/*.hpp src/*.cpp src/**/*.cpp --verbose --dry-run --Werror
- name: Run cppcheck
run: cppcheck -Iinclude/ src --verbose --enable=all --error-exitcode=1 --std=c++17 --language=c++ --suppressions-list=cppcheckSuppressions.txt --inline-suppr --check-level=exhaustive
- name: Configure for clang-tidy
run: cmake -S . -B build
- name: Clang-tidy
run: run-clang-tidy -j`nproc` -p=build -header-filter=`pwd`/include/ src/*.cpp src/**/*.cpp
memleak:
runs-on: ubuntu-latest
container: egecetinn/ubuntu2204
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Prepare
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Restore ccache
id: ccache-restore
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ env.CCACHE_DIR }}
key: memleak-ccache-${{ github.run_id }}
restore-keys: |
memleak-ccache
- name: Install Test Requirements
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install -r tests/data/requirements.txt
- name: Configure
run: cmake -DXXX_ENABLE_MEMLEAK_CHECK=ON -S . -B build
- name: Build
run: cmake --build build --parallel
- name: Run tests
run: |
. .venv/bin/activate
ctest --output-on-failure --test-dir build
- name: Save ccache
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
fuzztests:
runs-on: ubuntu-latest
container: egecetinn/ubuntu2204
strategy:
matrix:
sanitizer: [ASAN, USAN]
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Prepare
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Restore ccache
id: ccache-restore
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ env.CCACHE_DIR }}
key: ${{ matrix.sanitizer }}-ccache-${{ github.run_id }}
restore-keys: |
${{ matrix.sanitizer }}-ccache
- name: Install Test Requirements
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install -r tests/data/requirements.txt
- name: Configure
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DXXX_BUILD_UNITTESTS=OFF -DXXX_BUILD_FUZZTESTS=ON -DXXX_ENABLE_${{ matrix.sanitizer }}=ON -S . -B build
- name: Build
run: cmake --build build --parallel
- name: Run tests
run: |
. .venv/bin/activate
ctest --output-on-failure --test-dir build
- name: Save ccache
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
- name: Upload regressions
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: regressions-${{ matrix.sanitizer }}
path: build/tests/fuzztests/crash*
unittests:
runs-on: ubuntu-latest
container: egecetinn/${{ matrix.image }}
strategy:
matrix:
include:
- image: rockylinux8
- image: rockylinux9
- image: ubuntu2204
- image: ubuntu2404
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Prepare
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Restore ccache
id: ccache-restore
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ env.CCACHE_DIR }}
key: ${{ matrix.image }}-ccache-${{ github.run_id }}
restore-keys: |
${{ matrix.image }}-ccache
- name: Install Test Requirements
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install -r tests/data/requirements.txt
- name: Configure
run: cmake -S . -B build
- name: Build
run: cmake --build build --parallel
- name: Run Tests
run: |
. .venv/bin/activate
ctest --output-on-failure --test-dir build
- name: Save ccache
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}