-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (38 loc) · 1.39 KB
/
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
name: Tests
on:
- push
jobs:
build-test:
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
sonarcloud-build-wrapper : build-wrapper-linux-x86-64
- runner: ubuntu-20.04
sonarcloud-build-wrapper : build-wrapper-linux-x86-64
- runner: macos-latest
sonarcloud-build-wrapper : build-wrapper-macosx-x86
runs-on: ${{ matrix.platform.runner }}
steps:
- uses: actions/checkout@v3
- name: Install gcovr
run: pip3 install gcovr
- name: Setup sonar cloud
uses: SonarSource/[email protected]
- name: Build tests
run: cmake -B build -S .
- name: Build tests
run: ${{ matrix.platform.sonarcloud-build-wrapper }} --out-dir bw-output cmake --build build
- name: Run tests and coverage
run: ./build/tests/tests
- name: Generate coverage report
run: gcovr --exclude-throw-branches --exclude-unreachable-branches --sonarqube -o coverage.xml build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.AUTERION_CI_SONAR_TOKEN }}
run: |
sonar-scanner \
--define sonar.cfamily.build-wrapper-output="bw-output" \
--define sonar.coverageReportPaths=coverage.xml