-
Notifications
You must be signed in to change notification settings - Fork 1
209 lines (174 loc) · 7.4 KB
/
test.yml
File metadata and controls
209 lines (174 loc) · 7.4 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# Copyright Agustin K-ballo Berge, Fusion Fenix 2026
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
name: test
on:
push:
branches: [ main, feature/** ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
timeout-minutes: 6
strategy:
fail-fast: false
matrix:
include:
# ── Linux / GCC 14 ──
- os: ubuntu-24.04
compiler: gcc-14
preset: dev-gcc
# ── Linux / GCC 16 ──
- os: ubuntu-24.04
compiler: gcc-16
preset: dev-gcc
# ── Linux / Clang 18 ──
- os: ubuntu-24.04
compiler: clang-18
preset: dev-clang
# ── Linux / Clang 18 + libc++ ──
- os: ubuntu-24.04
compiler: clang-18+libc++
preset: dev-clang-libcxx
# ── Linux / Clang 22 ──
- os: ubuntu-24.04
compiler: clang-22
preset: dev-clang
# ── Linux / Clang 22 + libc++ ──
- os: ubuntu-24.04
compiler: clang-22+libc++
preset: dev-clang-libcxx
# ── Windows 2022 / MSVC 2022 ──
- os: windows-2022
compiler: msvc-2022
preset: dev-msvc
# ── Windows 2025 / MSVC 2026 ──
- os: windows-2025-vs2026
compiler: msvc-2026
preset: dev-msvc
# ── Windows 2025 / Clang-CL 20 ──
- os: windows-2025-vs2026
compiler: clang-cl-20
preset: dev-clang-cl
steps:
- uses: actions/checkout@v5
- name: Set up MSVC environment
if: startsWith(matrix.compiler, 'msvc') || startsWith(matrix.compiler, 'clang-cl')
shell: pwsh
run: |
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest -property installationPath
$vcvars = "$vsPath\VC\Auxiliary\Build\vcvars64.bat"
cmd /c "`"$vcvars`" && set" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') {
"$($Matches[1])=$($Matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
- name: Set up APT package cache
if: runner.os == 'Linux'
run: |
mkdir -p ~/.cache/apt/archives/partial
echo "Dir::Cache::archives \"$HOME/.cache/apt/archives\";" \
| sudo tee /etc/apt/apt.conf.d/99user-cache
- name: Cache APT packages
if: runner.os == 'Linux'
uses: actions/cache@v5
with:
path: ~/.cache/apt/archives
key: apt-${{ matrix.os }}-${{ matrix.compiler }}-${{ hashFiles('.github/workflows/test.yml') }}
restore-keys: apt-${{ matrix.os }}-${{ matrix.compiler }}-
- name: Install GCC 16
if: matrix.compiler == 'gcc-16'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -q
sudo apt-get install -y gcc-16 g++-16
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-16 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-16
- name: Install Clang 18
if: startsWith(matrix.compiler, 'clang-18')
run: |
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 200
- name: Install libc++-18
if: matrix.compiler == 'clang-18+libc++'
run: |
sudo apt-get install -y libc++-18-dev libc++abi-18-dev
- name: Install Clang 22 + libc++
if: startsWith(matrix.compiler, 'clang-22')
run: |
wget -q https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 22 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200
- name: Install Ninja
if: runner.os == 'Linux'
run: sudo apt-get install -y ninja-build
- name: Fix APT cache permissions
if: always() && runner.os == 'Linux'
run: sudo rm -rf ~/.cache/apt/archives/lock ~/.cache/apt/archives/partial
- name: Check CMake Version
run: cmake --version
# -----------------------------------------------------------------------
# Main project
# -----------------------------------------------------------------------
- name: Configure
run: cmake --preset ${{ matrix.preset }} -B build/${{ matrix.preset }}
- name: Build library (Debug)
run: cmake --build build/${{ matrix.preset }} --config Debug
--target _eggs_test_main
- name: Build tests (Debug)
continue-on-error: true
run: cmake --build build/${{ matrix.preset }} --config Debug -- -k 0
- name: Run header tests (Debug)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Debug
--label-regex header
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-debug-header.xml
- name: Run unit tests (Debug)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Debug
--label-regex unit
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-debug-unit.xml
- name: Run examples (Debug)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Debug
--label-regex example
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-debug-example.xml
- name: Build library (Release)
run: cmake --build build/${{ matrix.preset }} --config Release
--target _eggs_test_main
- name: Build tests (Release)
continue-on-error: true
run: cmake --build build/${{ matrix.preset }} --config Release -- -k 0
- name: Run header tests (Release)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Release
--label-regex header
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-release-header.xml
- name: Run unit tests (Release)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Release
--label-regex unit
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-release-unit.xml
- name: Run examples (Release)
run: ctest --test-dir build/${{ matrix.preset }} --build-config Release
--label-regex example
--output-on-failure
--no-compress-output
--output-junit test-results-${{ matrix.compiler }}-release-example.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v6
with:
name: test-results-${{ matrix.compiler }}
path: build/${{ matrix.preset }}/test-results-*.xml
retention-days: 30