-
Notifications
You must be signed in to change notification settings - Fork 11
131 lines (108 loc) · 3.61 KB
/
Copy pathci.yml
File metadata and controls
131 lines (108 loc) · 3.61 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
push:
pull_request:
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows MSVC
os: windows-latest
extra_args: ""
- name: Linux GCC ASan UBSan
os: ubuntu-latest
extra_args: "-DASTERISM_SANITIZERS=ON"
- name: macOS Clang
os: macos-latest
extra_args: ""
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: 20
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Configure
shell: bash
run: cmake -S . -B build -DUNIT_TEST=ON -DCMAKE_BUILD_TYPE=Debug ${{ matrix.extra_args }} > cmake_configure.log 2>&1 || (cat cmake_configure.log && exit 1)
- name: Build
run: cmake --build build --config Debug --parallel
- name: Test
run: ctest --test-dir build --build-config Debug --output-on-failure --timeout 180
- name: Smoke test (multi-process Relay/Agent/Portal/Client, TCP & UDP)
run: python test/smoke_test.py build
- name: Dump Configure Log on Failure
if: failure()
shell: bash
run: |
if [ -f cmake_configure.log ]; then
echo "### CMake Configure Log (${{ matrix.name }})" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat cmake_configure.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
fi
coverage:
name: Linux Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: 20
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install coverage tooling
run: python -m pip install --upgrade gcovr
- name: Configure
shell: bash
run: cmake -S . -B build-coverage -DUNIT_TEST=ON -DCMAKE_BUILD_TYPE=Debug -DASTERISM_COVERAGE=ON > cmake_configure.log 2>&1 || (cat cmake_configure.log && exit 1)
- name: Build
run: cmake --build build-coverage --parallel
- name: Test
run: ctest --test-dir build-coverage --output-on-failure --timeout 180
- name: Dump Configure Log on Failure
if: failure()
shell: bash
run: |
if [ -f cmake_configure.log ]; then
echo "### CMake Configure Log (Coverage)" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat cmake_configure.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
fi
- name: Coverage
run: >
gcovr
--root .
--filter src/asterism
--exclude 'src/asterism/(parg|s5)\.[ch]'
--exclude 3rdparty
--decisions
--xml-pretty -o coverage.xml
--print-summary
--fail-under-line 75
--fail-under-branch 40
--fail-under-decision 58
- uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-report
path: coverage.xml
- name: Upload coverage to Codecov
continue-on-error: true
run: |
curl -Os https://cli.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov upload-coverage --file coverage.xml --disable-search
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}