-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.53 KB
/
ci.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: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # to use node20 instead of node12 and node 16 which are deprecated
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2 # Use the latest major version for stability
with:
cmake-version: '3.26.3'
- name: Install dependencies
run: sudo apt-get install -y libgtest-dev libgmock-dev clang-tidy lcov #clang-format
- name: Configure CMake
run: |
rm -rf build
mkdir build
cd build
cmake ..
- name: Build Main Executable and Test Executable
run: |
cd build
make
- name: Analyze code with clang-tidy
run: |
cd build
make clean # Ensure a clean build to run clang-tidy on all files
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
clang-tidy -p .
#- name: Check code formatting with clang-format
# run: |
#find . -name '*.cpp' -o -name '*.h' | xargs clang-format -i
# cd build
# make clang-format-check
- name: Run Tests
run: |
cd build
ctest --output-on-failure
- name: Generate code coverage
run: |
cd build
make coverage
- name: Upload code coverage results
if: always()
uses: actions/upload-artifact@v2
with:
name: coverage-results
path: build/coverage-results