-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (96 loc) · 3.43 KB
/
ci.yml
File metadata and controls
109 lines (96 loc) · 3.43 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
checks: write
packages: read
jobs:
build-and-test:
name: Build & Test (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: clang
preset: debug-clang
- compiler: gcc
preset: debug-gcc
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Unshallow vcpkg submodule
run: git -C third/vcpkg fetch --unshallow
- name: Build devcontainer image
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/${{ github.repository }}/devcontainer
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
push: never
runCmd: |
./third/vcpkg/bootstrap-vcpkg.sh
cmake --workflow --preset=${{ matrix.preset }}
mkdir -p build/test-results
./build/debug/${{ matrix.compiler }}/test/unit_test \
--gtest_output=xml:build/test-results/unit_test.xml
./build/debug/${{ matrix.compiler }}/test/integration_test \
--gtest_output=xml:build/test-results/integration_test.xml
./build/debug/${{ matrix.compiler }}/test/thread_safety_test \
--gtest_output=xml:build/test-results/thread_safety_test.xml
- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.compiler }}
path: build/test-results/*.xml
- name: Publish test report
if: success() || failure()
uses: dorny/test-reporter@v1
with:
name: Test Results (${{ matrix.compiler }})
path: build/test-results/*.xml
reporter: java-junit
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Unshallow vcpkg submodule
run: git -C third/vcpkg fetch --unshallow
- name: Build devcontainer and run coverage
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/${{ github.repository }}/devcontainer
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
push: never
runCmd: |
./third/vcpkg/bootstrap-vcpkg.sh
cmake --workflow --preset=coverage
ninja -C build/coverage coverage
ninja -C build/coverage coverage-xml
echo "## Coverage Summary" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
llvm-cov report \
build/coverage/test/unit_test \
--object=build/coverage/test/integration_test \
--object=build/coverage/test/thread_safety_test \
-instr-profile=build/coverage/coverage.profdata \
"-ignore-filename-regex=(third|test|benchmark|build|examples|vcpkg_installed)/.*" \
2>/dev/null >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage report
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
build/coverage/coverage/
build/coverage/coverage/coverage.lcov