forked from dds-bridge/dds
-
Notifications
You must be signed in to change notification settings - Fork 0
300 lines (261 loc) · 9.73 KB
/
Copy pathci_linux.yml
File metadata and controls
300 lines (261 loc) · 9.73 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# .github/workflows/ci_linux.yml
name: CI – Linux
on:
pull_request:
branches: [main, develop]
workflow_dispatch: {}
jobs:
build_and_test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
# 1️⃣ Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
# 2️⃣ Free up disk space (LLVM toolchain ~4 GB extracted; runners ship ~14 GB free)
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
# 3️⃣ Install Bazelisk (recommended Bazel launcher)
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
# 4️⃣ (Optional) Install Doxygen for documentation generation
- name: Install Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen
# 5️⃣ Prefetch external repos (emsdk via //..., LLVM); retry network flakes only
- name: Prefetch external repos
run: |
max=3
for i in $(seq 1 "$max"); do
if bazelisk fetch //...; then
exit 0
fi
if [ "$i" -lt "$max" ]; then
echo "Fetch failed (attempt $i/$max). Retrying in 20s..."
sleep 20
fi
done
exit 1
# 6️⃣ Build all targets
- name: Build all targets
run: bazelisk build --verbose_failures //...
# 7️⃣ .NET binding — build and test the managed wrapper against the shared
# library just built. Kept immediately after "Build all targets" (and
# before the non-default-flag builds below) since both target the
# same default configuration; the flag builds mutate the active
# config, so anything default-config-dependent stays on this side of
# them. Pinned to 8.0.x because that is what DDS_Core targets; the
# test project's RollForward only matters where no 8.0 runtime
# exists, which is not the case here.
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
# bazel-bin is a configuration-dependent convenience symlink, so ask Bazel
# for it rather than hardcoding a path that a different --config would move.
- name: Test .NET binding
run: |
bazelisk build --verbose_failures //jni:dds_shared
export DDS_LIBRARY_PATH="$(bazelisk info bazel-bin)/jni/libdds.so"
test -f "$DDS_LIBRARY_PATH" || { echo "native library not found at $DDS_LIBRARY_PATH"; exit 1; }
# Both configurations: ThrowIfError is unconditional, so a regression to
# [Conditional("DEBUG")] only surfaces in Release. See dotnet-binding.md.
dotnet test dotnet/DDS_Core.Tests/ --verbosity normal
dotnet test dotnet/DDS_Core.Tests/ -c Release --verbosity normal
# DdTableForDeal unit helpers (no native library required).
dotnet test dotnet/DdTableForDeal.Tests/ --verbosity normal
dotnet test dotnet/DdTableForDeal.Tests/ -c Release --verbosity normal
# CLI e2e: bash drives `dotnet run` against the native library.
chmod +x dotnet/DdTableForDeal/e2e.sh
./dotnet/DdTableForDeal/e2e.sh
# 8️⃣ Run all tests (including Python), still under the default config.
- name: Run all tests
run: bazelisk test --verbose_failures //...
# --- Non-default-flag builds below. Each mutates the active Bazel
# config (bazel-bin, etc.), so they are kept together and last, after
# everything above that depends on the default configuration.
# 9️⃣ Build with DDS_AB_STATS (off by default; compile-gated AB counters)
- name: Build with ab_stats define
run: bazelisk build --define=ab_stats=true --verbose_failures //library/src:dds
- name: Test with ab_stats define
run: bazelisk test --define=ab_stats=true --verbose_failures --test_output=errors //library/tests/ab_search:ab_stats_test //library/tests/ab_search:tt_lookup_test
# 🔟 Build with DDS_SCHEDULER (off by default; compile-gated timing path)
- name: Build with scheduler define
run: bazelisk build --define=scheduler=true --verbose_failures //library/src:dds
# 11 Upload test logs
- name: Upload test logs - Linux
if: always()
uses: actions/upload-artifact@v6
with:
name: bazel-test-logs-linux
path: bazel-testlogs/
if-no-files-found: ignore
retention-days: 30
asan:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Prefetch external repos
run: |
max=3
for i in $(seq 1 "$max"); do
if bazelisk fetch --config=asan //library/tests/...; then
exit 0
fi
if [ "$i" -lt "$max" ]; then
echo "Fetch failed (attempt $i/$max). Retrying in 20s..."
sleep 20
fi
done
exit 1
- name: Run tests (AddressSanitizer)
run: bazelisk test --config=asan --verbose_failures --test_output=errors //library/tests/...
- name: Upload ASAN test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: bazel-test-logs-linux-asan
path: bazel-testlogs/
if-no-files-found: ignore
retention-days: 30
tsan:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Prefetch external repos
run: |
max=3
for i in $(seq 1 "$max"); do
if bazelisk fetch --config=tsan //library/tests/system/...; then
exit 0
fi
if [ "$i" -lt "$max" ]; then
echo "Fetch failed (attempt $i/$max). Retrying in 20s..."
sleep 20
fi
done
exit 1
- name: Run system tests (ThreadSanitizer)
run: bazelisk test --config=tsan --verbose_failures --test_output=errors //library/tests/system/...
- name: Upload TSAN test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: bazel-test-logs-linux-tsan
path: bazel-testlogs/
if-no-files-found: ignore
retention-days: 30
ubsan:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Prefetch external repos
run: |
max=3
for i in $(seq 1 "$max"); do
if bazelisk fetch --config=ubsan //library/tests/...; then
exit 0
fi
if [ "$i" -lt "$max" ]; then
echo "Fetch failed (attempt $i/$max). Retrying in 20s..."
sleep 20
fi
done
exit 1
- name: Run tests (UndefinedBehaviorSanitizer)
run: bazelisk test --config=ubsan --verbose_failures --test_output=errors //library/tests/...
- name: Upload UBSAN test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: bazel-test-logs-linux-ubsan
path: bazel-testlogs/
if-no-files-found: ignore
retention-days: 30
msan:
# Pin to 22.04: MODULE.bazel's MSAN LLVM + instrumented libc++ overlay are
# the Ubuntu 22.04 builds; ubuntu-latest drift would break the overlay match.
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Prefetch external repos
run: |
max=3
for i in $(seq 1 "$max"); do
if bazelisk fetch --config=msan //library/tests/...; then
exit 0
fi
if [ "$i" -lt "$max" ]; then
echo "Fetch failed (attempt $i/$max). Retrying in 20s..."
sleep 20
fi
done
exit 1
- name: Run tests (MemorySanitizer)
run: bazelisk test --config=msan --verbose_failures --test_output=errors //library/tests/...
- name: Upload MSAN test logs
if: always()
uses: actions/upload-artifact@v6
with:
name: bazel-test-logs-linux-msan
path: bazel-testlogs/
if-no-files-found: ignore
retention-days: 30