-
Notifications
You must be signed in to change notification settings - Fork 27
61 lines (60 loc) · 1.74 KB
/
test.yml
File metadata and controls
61 lines (60 loc) · 1.74 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
50
51
52
53
54
55
56
57
58
59
60
61
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
jobs:
test-ubuntu:
name: Test and Coverage Reports
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --assume-yes --no-install-recommends \
check \
gcovr \
meson \
ninja-build
- name: Configure
run: |
meson setup build \
-Db_coverage=true \
-Denable-tests=true
- name: Build
run: meson compile -C build
- name: Run unit tests
run: meson test -C build
- name: Run code coverage
run: ninja coverage -C build
- name: Publish test report
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0
if: success() || failure()
with:
report_paths: build/meson-logs/testlog.junit.xml
include_passed: true
- name: Report code coverage
uses: threeal/gcovr-action@64cb417ed6f143cafe1c69611922672002f460bb # v1.2.0
with:
excludes: 'tests/.*'
github-token: ${{ secrets.GITHUB_TOKEN }}
xml-out: build/meson-logs/coverage.xml
- uses: 5monkeys/cobertura-action@ee5787cc56634acddedc51f21c7947985531e6eb # v14
with:
path: build/meson-logs/coverage.xml
fail_below_threshold: true
minimum_coverage: 50
show_line: true
show_branch: true