-
Notifications
You must be signed in to change notification settings - Fork 50
76 lines (64 loc) · 2.01 KB
/
coverage.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: Coverage
on:
push:
paths:
- '.github/**'
- 'cmake/**'
- 'include/**'
- 'scripts/**'
- 'src/**'
- 'tests/**'
- '**/CMakeLists.txt'
pull_request:
paths:
- '.github/**'
- 'cmake/**'
- 'include/**'
- 'scripts/**'
- 'src/**'
- 'tests/**'
- '**/CMakeLists.txt'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}-${{ github.event.schedule }}
cancel-in-progress: true
jobs:
codecov:
runs-on: ubuntu-22.04
steps:
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
- name: Create Build Environment
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
sudo apt-get install -yq lcov
mkdir ${{ runner.workspace }}/build
mkdir ${{ runner.workspace }}/report
- name: Checkout
uses: actions/checkout@v4
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=20 \
-DSCN_TESTS_LOCALIZED=ON -DSCN_COVERAGE=ON \
$GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: |
cmake --build . -- -k 0
- name: Generate Coverage Report
working-directory: ${{ runner.workspace }}/build
run: |
./coverage.sh
cp coverage-filtered.info ${{ runner.workspace }}/report/coverage.info
- name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
directory: ${{ runner.workspace }}/report
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}