-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (201 loc) · 7.62 KB
/
Copy pathci.yml
File metadata and controls
237 lines (201 loc) · 7.62 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
# The library builds on every push/PR across all three platforms for
# early compile-failure signal. Release publishing (provenance, SBOM,
# cosign signatures) is handled by the separate release.yml workflow
# so the tests here stay a pure gate.
strategy:
matrix:
include:
- os: ubuntu-latest
artifact-suffix: linux-x64
shared-lib: libarkilian.so
static-lib: libarkilian.a
- os: macos-latest
artifact-suffix: darwin-x64
shared-lib: libarkilian.dylib
static-lib: libarkilian.a
- os: windows-latest
artifact-suffix: windows-x64
shared-lib: arkilian.dll
static-lib: arkilian.lib
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tidy
- name: Install Dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
$vcpkgPath = "${{ runner.temp }}/vcpkg"
git clone https://github.com/microsoft/vcpkg.git $vcpkgPath
& "$vcpkgPath/bootstrap-vcpkg.bat"
& "$vcpkgPath/vcpkg" install curl:x64-windows
echo "VCPKG_ROOT=$vcpkgPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DARKILIAN_BUILD_EXAMPLES=OFF
shell: pwsh
- name: Configure CMake (Unix)
if: matrix.os != 'windows-latest'
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DARKILIAN_BUILD_EXAMPLES=OFF
- name: Build
run: cmake --build build --config Release
test:
# The C suite, Go control plane, and Node binding run on every
# push/PR. Windows is exercised via MSYS2 UCRT64 MinGW so the tests
# build with the same POSIX-thread/socket API the library targets
# (the MSVC `build` job above covers native compile-fitness).
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
install-deps: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tidy
- os: macos-latest
install-deps: |
brew install curl
echo "CMAKE_PREFIX_PATH=$(brew --prefix curl)" >> "$GITHUB_ENV"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies (Unix)
if: matrix.os != 'windows-latest'
run: ${{ matrix.install-deps }}
- name: Setup MSYS2 UCRT64 (Windows)
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-curl
mingw-w64-ucrt-x86_64-make
- name: Setup Go (Unix)
if: matrix.os != 'windows-latest'
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Configure CMake (with tests, Unix)
if: matrix.os != 'windows-latest'
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug \
-DARKILIAN_BUILD_TESTS=ON -DARKILIAN_BUILD_EXAMPLES=OFF
- name: Configure CMake (with tests, Windows/MSYS2)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
cmake -B build -S . -G "MinGW Makefiles" \
-DCMAKE_PREFIX_PATH=/ucrt64 \
-DCMAKE_BUILD_TYPE=Debug \
-DARKILIAN_BUILD_TESTS=ON -DARKILIAN_BUILD_EXAMPLES=OFF
- name: Build (with tests, Unix)
if: matrix.os != 'windows-latest'
run: cmake --build build --config Debug
- name: Build (with tests, Windows/MSYS2)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: cmake --build build --config Debug
- name: C test suites (ctest — all 10, Unix)
if: matrix.os != 'windows-latest'
working-directory: build
run: ctest --output-on-failure
- name: C test suites (ctest — Windows/MSYS2)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
working-directory: build
run: ctest --output-on-failure
- name: Go control-plane tests
if: matrix.os != 'windows-latest'
run: |
cd server
go test ./...
- name: Node binding build + tests
# Node binding is platform-portable; only exercise it on Linux to
# avoid redundant node-gyp toolchain setup on macOS (the build job
# already builds the lib on both).
if: matrix.os == 'ubuntu-latest'
run: |
npm ci
npm test
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tidy
- name: Configure CMake
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DARKILIAN_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build build --config Debug
- name: Run Example
run: ./build/arkilian_example
# Sanitizers: the backup subsystem is a multi-threaded C library that
# ships durability guarantees. ASAN+UBSAN catch the memory and UB
# regressions that -Wall cannot (use-after-free, OOB read, signed
# overflow, NULL-deref through freed memory). CONTRIBUTING.md mandates
# "rigorous memory safety verification"; this job makes it real.
sanitizer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tidy
- name: Configure (ASAN + UBSAN, tests ON)
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug \
-DARKILIAN_BUILD_TESTS=ON -DARKILIAN_BUILD_EXAMPLES=OFF \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
- name: Build
run: cmake --build build --config Debug
- name: Run tests under sanitizer
working-directory: build
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1:abort_on_error=1
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
run: ctest --output-on-failure
# ThreadSanitizer: the client runs dedicated game, flush, and snapshot
# threads plus a hydration single-flight path. ASAN+UBSAN cannot see
# data races between those threads; TSAN gates synchronization
# regressions (e.g. a missed mutex on a shared heartbeat counter).
tsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tidy
- name: Configure (TSAN, tests ON)
run: |
cmake -B build-tsan -S . -DCMAKE_BUILD_TYPE=Debug \
-DARKILIAN_BUILD_TESTS=ON -DARKILIAN_BUILD_EXAMPLES=OFF \
-DCMAKE_C_FLAGS="-fsanitize=thread -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread"
- name: Build (TSAN)
run: cmake --build build-tsan --config Debug
- name: Run tests under ThreadSanitizer
working-directory: build-tsan
env:
TSAN_OPTIONS: halt_on_error=1:abort_on_error=1
run: ctest --output-on-failure