-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (113 loc) · 3.92 KB
/
ci.yml
File metadata and controls
138 lines (113 loc) · 3.92 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
132
133
134
135
136
137
138
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
env:
CTEST_TIMEOUT: 120
CLANG_VERSION: "20"
jobs:
build-and-test:
name: Build & Test (${{ matrix.os }}, C++${{ matrix.cxx_standard }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
cxx_standard: [17, 20]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Setup Clang
uses: ./.github/actions/setup-clang
with:
clang-version: ${{ env.CLANG_VERSION }}
- name: Build
run: |
CMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} \
CMAKE_C_COMPILER=clang-${{ env.CLANG_VERSION }} \
CMAKE_CXX_COMPILER=clang++-${{ env.CLANG_VERSION }} \
make debug
- name: Run tests
run: |
cd ${{github.workspace}}/build
xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +extension GLX +render -noreset" ctest --output-on-failure --verbose --timeout ${{ env.CTEST_TIMEOUT }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-cpp${{ matrix.cxx_standard }}
path: |
${{github.workspace}}/build/Testing/
${{github.workspace}}/build/test/
sanitizer-analysis:
name: Sanitizer Analysis (${{ matrix.sanitizer }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
sanitizer: [asan, tsan]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Setup Clang
uses: ./.github/actions/setup-clang
with:
clang-version: ${{ env.CLANG_VERSION }}
- name: Build with sanitizer
run: |
CMAKE_C_COMPILER=clang-${{ env.CLANG_VERSION }} \
CMAKE_CXX_COMPILER=clang++-${{ env.CLANG_VERSION }} \
make ${{ matrix.sanitizer }}
- name: Run tests with sanitizer
run: |
build_dir="build-${{ matrix.sanitizer }}"
cd $build_dir
# Set sanitizer options
if [ "${{ matrix.sanitizer }}" = "asan" ]; then
export ASAN_OPTIONS="detect_leaks=1:abort_on_error=1"
elif [ "${{ matrix.sanitizer }}" = "tsan" ]; then
export TSAN_OPTIONS="abort_on_error=1"
fi
xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +extension GLX +render -noreset" ctest --output-on-failure --verbose --timeout ${{ env.CTEST_TIMEOUT }}
- name: Upload sanitizer results
if: always()
uses: actions/upload-artifact@v4
with:
name: sanitizer-results-${{ matrix.sanitizer }}
path: |
build-${{ matrix.sanitizer }}/Testing/
build-${{ matrix.sanitizer }}/test/
coverage-analysis:
name: Coverage Analysis
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Install lcov
run: |
sudo apt-get install -y lcov
- name: Generate coverage report
run: |
xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +extension GLX +render -noreset" make coverage
- name: Upload HTML coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
coverage/
build-coverage/coverage_filtered.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build-coverage/coverage_filtered.info
fail_ci_if_error: true