-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
361 lines (349 loc) · 13.3 KB
/
Copy pathsanitized_ci.yml
File metadata and controls
361 lines (349 loc) · 13.3 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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
name: Sanitized CI
## Running these jobs is slow (over ~1 hour, sometimes even 2)
## so we run them only when there is a chance that the generated
## C code could have changed, or for some critical vlib modules,
## like `builtin`, `os`, `sync`, where they have demonstrated
## their usefulness by catching actual very hard to find bugs.
## The cost of this selective running is delayed feedback when
## there are bugs in other V modules.
## The positive is *much faster CI runs* for most V contributors,
## that make PRs that are not concerning V itself, or the critical
## V modules.
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '!**'
- '!**.md'
- '!**.yml'
- 'vlib/builtin/**.v'
- 'vlib/strconv/**.v'
- 'vlib/strings/**.v'
- 'vlib/math/**.v'
- 'vlib/math/big/**.v'
- 'vlib/arrays/**.v'
- 'vlib/crypto/ecdsa/**.v'
- 'vlib/datatypes/**.v'
- 'vlib/os/**.v'
- 'vlib/sync/**.v'
- 'vlib/v/tests/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/v/preludes/**.v'
- 'vlib/v/embed_file/**.v'
- 'vlib/json2/**.v'
- '**/sanitized_ci.yml'
pull_request:
paths:
- '!**'
- 'vlib/builtin/**.v'
- 'vlib/strconv/**.v'
- 'vlib/strings/**.v'
- 'vlib/math/**.v'
- 'vlib/math/big/**.v'
- 'vlib/arrays/**.v'
- 'vlib/crypto/ecdsa/**.v'
- 'vlib/datatypes/**.v'
- 'vlib/os/**.v'
- 'vlib/sync/**.v'
- 'vlib/v/tests/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/v/preludes/**.v'
- 'vlib/v/embed_file/**.v'
- 'vlib/json2/**.v'
- '**/sanitized_ci.yml'
concurrency:
group: sanitized-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
env:
SANITIZER_BASE_PACKAGES: >-
postgresql libpq-dev libssl-dev sqlite3 libsqlite3-dev valgrind
SANITIZER_GRAPHICS_PACKAGES: >-
libfreetype6-dev libxi-dev libxcursor-dev libgl-dev libxrandr-dev
libasound2-dev libegl-dev
SANITIZER_CLANG_PACKAGES: clang
jobs:
sanitize-undefined-clang:
runs-on: ubuntu-22.04
timeout-minutes: 120
env:
VFLAGS: -cc clang -cflags -fno-omit-frame-pointer
VJOBS: 1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_undefined.suppressions
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with -cstrict
run: ./v -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=undefined)
run: |
./v -cflags -fsanitize=undefined -o v2 cmd/v
./v2 -cflags -fsanitize=undefined -silent test-self vlib
- name: Build examples (V compiled with -fsanitize=undefined)
run: ./v2 -silent build-examples
sanitize-undefined-gcc:
runs-on: ubuntu-22.04
timeout-minutes: 150
env:
VFLAGS: -cc gcc -cflags -fno-omit-frame-pointer
VJOBS: 1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_undefined.suppressions
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
- name: Recompile V with -cstrict
run: ./v -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=undefined)
run: |
./v -cflags -fsanitize=undefined -o v2 cmd/v
./v2 -cflags -fsanitize=undefined -silent test-self vlib
- name: Build examples (V compiled with -fsanitize=undefined)
run: ./v2 -silent build-examples
sanitize-address-clang:
runs-on: ubuntu-22.04
timeout-minutes: 300
env:
VFLAGS: -cc clang -cflags -fno-omit-frame-pointer
VJOBS: 1
ASAN_OPTIONS: detect_leaks=1
LSAN_OPTIONS: max_leaks=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_leak.suppressions
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with -cstrict
run: ./v -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=address)
run: ./v -cflags -fsanitize=address,pointer-compare,pointer-subtract -silent test-self vlib
- name: Test vlib/v/tests/ (V compiled with -fsanitize=address)
run: |
./v -cflags -fsanitize=address -o v cmd/v
./v -cc tcc -silent test-self -asan-compiler vlib/v/tests/
- name: Build examples (V compiled with -fsanitize=address)
run: ./v -silent build-examples
sanitize-address-msvc:
runs-on: windows-2025
timeout-minutes: 30
env:
VFLAGS: -cc msvc
VJOBS: 1
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- name: Build
run: |
echo %VFLAGS%
echo $VFLAGS
.\makev.bat -msvc
.\v.exe self
- name: V doctor
run: .\v.exe doctor
- name: Ensure code is well formatted
run: .\v.exe -silent test-cleancode
# - name: Install dependencies
# run: |
# .\v.exe setup-freetype
# .\.github\workflows\windows-install-sqlite.bat
# - name: Self tests (/fsanitize=address) # TODO:
# run: .\v.exe -cflags "/fsanitize=address" -silent test-self vlib
sanitize-address-gcc:
runs-on: ubuntu-22.04
timeout-minutes: 300
env:
VFLAGS: -cc gcc -cflags -fno-omit-frame-pointer
VJOBS: 1
ASAN_OPTIONS: detect_leaks=1
LSAN_OPTIONS: max_leaks=1:print_suppressions=0:suppressions=/home/runner/work/v/v/.github/workflows/run_sanitizers_leak.suppressions
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with -cstrict
run: ./v -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=address)
run: ./v -cflags -fsanitize=address -silent test-self vlib
- name: Test vlib/v/tests/ (V compiled with -fsanitize=address)
run: |
./v -cflags -fsanitize=address,pointer-compare,pointer-subtract -o v cmd/v
./v -cc tcc -silent test-self -asan-compiler vlib/v/tests/
- name: Build examples (V compiled with -fsanitize=address)
run: ./v -silent build-examples
sanitize-memory-clang:
runs-on: ubuntu-22.04
timeout-minutes: 300
env:
VFLAGS: -cc clang -gc none -cflags -fno-omit-frame-pointer
VJOBS: 1
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with clang and -cstrict
run: ./v -cc clang -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=memory)
run: ./v -cflags -fsanitize=memory -silent test-self -msan-compiler vlib
sanitize-memory-clang-compiler:
runs-on: ubuntu-22.04
timeout-minutes: 300
env:
VFLAGS: -cc clang -gc none -cflags -fno-omit-frame-pointer
VJOBS: 1
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with clang and -cstrict
run: ./v -cc clang -cg -cstrict -o v cmd/v
- name: Test vlib/v/tests/ (V compiled with -fsanitize=memory)
run: |
# Preserve existing `// vtest build: !sanitize-memory-clang` exclusions.
GITHUB_JOB=sanitize-memory-clang ./v -cflags -fsanitize=memory -o v cmd/v
GITHUB_JOB=sanitize-memory-clang ./v -cc tcc -silent test-self -msan-compiler vlib/v/tests/
- name: Build examples (V compiled with -fsanitize=memory)
run: GITHUB_JOB=sanitize-memory-clang ./v -silent build-examples
sanitize-address-clang-without-gc:
runs-on: ubuntu-22.04
timeout-minutes: 300
env:
VFLAGS: -cc clang -gc none -cflags -fno-omit-frame-pointer
VJOBS: 1
LSAN_OPTIONS: detect_leaks=0
VNATIVE_SKIP_LIBC_VV: 1
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
steps:
- uses: actions/checkout@v7.0.1
- uses: ./.github/actions/cache-apt-packages-action
- name: Build V
run: make -j4 && ./v symlink
- name: V doctor
run: ./v doctor
- name: Ensure code is well formatted
run: ./v -silent test-cleancode
- name: Install dependencies
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y $SANITIZER_BASE_PACKAGES
./v retry -- sudo apt install --quiet -y $SANITIZER_GRAPHICS_PACKAGES
./v retry -- sudo apt install $SANITIZER_CLANG_PACKAGES
- name: Recompile V with -cstrict
run: ./v -cg -cstrict -o v cmd/v
- name: Self tests (-fsanitize=address)
run: ./v -cflags -fsanitize=address -silent test-self vlib