Repository navigation
205 lines (194 loc) · 6.89 KB
/
Copy pathci.yml
File metadata and controls
205 lines (194 loc) · 6.89 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Format and static analysis
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
cache: true
- name: Check formatting
run: pixi run format-check
- name: Run clang-tidy
run: pixi run tidy
- name: Validate workflow configuration
run: pixi run workflow-check
- name: Test release publication states
run: bash test/release_publish_test.sh
build-and-test:
name: ${{ matrix.compiler.name }} ${{ matrix.build_type }} ${{ matrix.library }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC
cxx: g++
- name: Clang
cxx: clang++
build_type: [Debug, Release]
library: [shared, static]
include:
- library: shared
build_shared: "ON"
- library: static
build_shared: "OFF"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
cache: true
- name: Configure
run: >-
pixi run cmake -S . -B build/ci -G Ninja
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_SHARED_LIBS=${{ matrix.build_shared }}
-DBUILD_TESTING=ON
- name: Build
run: pixi run cmake --build build/ci
- name: Test
run: pixi run ctest --test-dir build/ci --output-on-failure
- name: Test installed package
env:
NETFT_CXX_COMPILER: ${{ matrix.compiler.cxx }}
run: pixi run bash test/install_test.sh ${{ matrix.library }}
cmake-316:
name: CMake 3.16 compatibility
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
cache: true
- name: Verify pinned CMake version
run: pixi run -e cmake-316 cmake --version | grep -E '^cmake version 3\.16\.'
- name: Test shared and static consumers
run: pixi run -e cmake-316 cmake-316-test
gcc-10:
name: GCC 10 compatibility
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
- name: Build and test with GCC 10
run: bash test/gcc10_compatibility_test.sh
sanitizers:
name: ASan and UBSan
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
cache: true
- name: Configure
run: >-
pixi run cmake -S . -B build/sanitizers -G Ninja
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=ON
-DNETFT_SANITIZERS=ON
- name: Build
run: pixi run cmake --build build/sanitizers
- name: Test
env:
ASAN_OPTIONS: detect_leaks=1:strict_string_checks=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
run: pixi run ctest --test-dir build/sanitizers --output-on-failure
arm64:
name: ARM64 Release shared
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
cache: true
- name: Configure
run: >-
pixi run cmake -S . -B build/arm64 -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=ON
- name: Build
run: pixi run cmake --build build/arm64
- name: Test
run: pixi run ctest --test-dir build/arm64 --output-on-failure
- name: Test installed package
run: pixi run shared-test
macos:
name: macOS Release static
runs-on: macos-15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install dependencies
run: brew install curl googletest ninja
- name: Configure
run: >-
cmake -S . -B build/macos -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH="$(brew --prefix curl);$(brew --prefix googletest)"
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=ON
- name: Build
run: cmake --build build/macos
- name: Test
run: ctest --test-dir build/macos --output-on-failure
- name: Install
run: cmake --install build/macos --prefix "$RUNNER_TEMP/netft"
- name: Test installed consumer
run: |
cmake -S test/consumer -B build/macos-consumer -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$RUNNER_TEMP/netft;$(brew --prefix curl)"
cmake --build build/macos-consumer
./build/macos-consumer/netft_consumer
windows:
name: Windows Release static
runs-on: windows-2025
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install dependencies
shell: pwsh
run: >-
vcpkg install
curl:x64-windows
gtest:x64-windows
- name: Configure
shell: pwsh
run: >-
cmake -S . -B build/windows
"-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=x64-windows
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=ON
- name: Build
run: cmake --build build/windows --config Release
- name: Test
run: ctest --test-dir build/windows -C Release --output-on-failure
- name: Install
shell: pwsh
run: cmake --install build/windows --config Release --prefix "$env:RUNNER_TEMP/netft"
- name: Test installed consumer
shell: pwsh
run: |
cmake -S test/consumer -B build/windows-consumer `
"-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows `
"-DCMAKE_PREFIX_PATH=$env:RUNNER_TEMP/netft"
cmake --build build/windows-consumer --config Release
& build/windows-consumer/Release/netft_consumer.exe