-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.39 KB
/
Copy pathci.yml
File metadata and controls
49 lines (40 loc) · 1.39 KB
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
name: CI & Tests
on:
push:
branches: ['main', 'master']
pull_request:
branches: ['main', 'master']
jobs:
test-and-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
key: ${{ github.job }}-${{ runner.os }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y xorg-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev gcovr
- name: Configure CMake
run: cmake -B build -DBUILD_TESTING=ON -DENABLE_COVERAGE=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build tests
run: cmake --build build --target fast_notepad_tests --parallel
- name: Run tests
run: cd build && ctest --output-on-failure
- name: Generate Code Coverage Report
run: |
mkdir -p coverage
gcovr -r . --object-directory build \
--filter "src/.*" \
--xml coverage/coverage.xml \
--html-details coverage/index.html \
--print-summary
- name: Upload Coverage Artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: coverage/