Skip to content

Commit 00b6306

Browse files
committed
Enable asan for all CI tests
1 parent edbe7aa commit 00b6306

File tree

1 file changed

+59
-29
lines changed

1 file changed

+59
-29
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,13 @@ jobs:
7575
fail-fast: false
7676
matrix:
7777
# MacOS 13 runs on Intel, 14 runs on ARM
78-
os: [ubuntu-latest, macos-13, macos-14]
78+
os: [macos-13, macos-14]
7979
runs-on: ${{ matrix.os }}
80-
name: ${{ matrix.os == 'macos-14' && 'MacOS ARM' || (matrix.os == 'macos-13' && 'MacOS Intel' || 'Ubuntu') }} Build, Check, and Test
80+
name: ${{ matrix.os == 'macos-14' && 'MacOS ARM' || (matrix.os == 'macos-13' && 'MacOS Intel') }} Build, Check, and Test
8181
timeout-minutes: 15
8282
steps:
83-
- uses: actions/checkout@v4
8483

85-
- name: Download LLVM (Linux)
86-
if: matrix.os == 'ubuntu-latest'
87-
run: |
88-
wget https://apt.llvm.org/llvm.sh
89-
chmod +x llvm.sh
90-
sudo ./llvm.sh 20
91-
echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH
84+
- uses: actions/checkout@v4
9285

9386
- name: Download LLVM (MacOS Intel)
9487
if: matrix.os == 'macos-13'
@@ -136,40 +129,77 @@ jobs:
136129
cd tests/issues
137130
./run.sh
138131
132+
- name: Run demo on WASI WASM32
133+
run: |
134+
./odin build examples/demo -target:wasi_wasm32 -vet -strict-style -disallow-do -out:demo
135+
wasmtime ./demo.wasm
136+
if: matrix.os == 'macos-14'
137+
138+
build_ubuntu:
139+
name: Ubuntu Build, Check, and Test
140+
runs-on: ubuntu-latest
141+
steps:
142+
- uses: actions/checkout@v4
143+
- name: Download LLVM
144+
run: |
145+
wget https://apt.llvm.org/llvm.sh
146+
chmod +x llvm.sh
147+
sudo ./llvm.sh 20
148+
echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH
149+
150+
- name: Build Odin
151+
run: ./build_odin.sh release
152+
- name: Odin version
153+
run: ./odin version
154+
- name: Odin report
155+
run: ./odin report
156+
- name: Compile needed Vendor
157+
run: |
158+
make -C vendor/stb/src
159+
make -C vendor/cgltf/src
160+
make -C vendor/miniaudio/src
161+
- name: Odin check
162+
run: ./odin check examples/demo -vet
163+
- name: Odin run
164+
run: ./odin run examples/demo
165+
- name: Odin run -debug
166+
run: ./odin run examples/demo -debug
167+
- name: Odin check examples/all
168+
run: ./odin check examples/all -strict-style -vet -disallow-do
169+
- name: Odin check vendor/sdl3
170+
run: ./odin check vendor/sdl3 -strict-style -vet -disallow-do -no-entry-point
171+
- name: Normal Core library tests
172+
run: ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
173+
- name: Optimized Core library tests
174+
run: ./odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
175+
- name: Vendor library tests
176+
run: ./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
177+
- name: Internals tests
178+
run: ./odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
179+
- name: GitHub Issue tests
180+
run: |
181+
cd tests/issues
182+
./run.sh
183+
139184
- name: Check benchmarks
140185
run: ./odin check tests/benchmark -vet -strict-style -no-entry-point
141186
- name: Odin check examples/all for Linux i386
142187
run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_i386
143-
if: matrix.os == 'ubuntu-latest'
144188
- name: Odin check examples/all for Linux arm64
145189
run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_arm64
146-
if: matrix.os == 'ubuntu-latest'
147190
- name: Odin check examples/all for FreeBSD amd64
148191
run: ./odin check examples/all -vet -strict-style -disallow-do -target:freebsd_amd64
149-
if: matrix.os == 'ubuntu-latest'
150192
- name: Odin check examples/all for OpenBSD amd64
151193
run: ./odin check examples/all -vet -strict-style -disallow-do -target:openbsd_amd64
152-
if: matrix.os == 'ubuntu-latest'
153194

154195
- name: Odin check vendor/sdl3 for Linux i386
155196
run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_i386
156-
if: matrix.os == 'ubuntu-latest'
157197
- name: Odin check vendor/sdl3 for Linux arm64
158198
run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_arm64
159-
if: matrix.os == 'ubuntu-latest'
160199
- name: Odin check vendor/sdl3 for FreeBSD amd64
161200
run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:freebsd_amd64
162-
if: matrix.os == 'ubuntu-latest'
163201
- name: Odin check vendor/sdl3 for OpenBSD amd64
164202
run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:openbsd_amd64
165-
if: matrix.os == 'ubuntu-latest'
166-
167-
168-
- name: Run demo on WASI WASM32
169-
run: |
170-
./odin build examples/demo -target:wasi_wasm32 -vet -strict-style -disallow-do -out:demo
171-
wasmtime ./demo.wasm
172-
if: matrix.os == 'macos-14'
173203

174204
build_windows:
175205
name: Windows Build, Check, and Test
@@ -215,23 +245,23 @@ jobs:
215245
shell: cmd
216246
run: |
217247
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
218-
odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
248+
odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
219249
- name: Optimized core library tests
220250
shell: cmd
221251
run: |
222252
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
223-
odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
253+
odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
224254
- name: Vendor library tests
225255
shell: cmd
226256
run: |
227257
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
228258
copy vendor\lua\5.4\windows\*.dll .
229-
odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
259+
odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
230260
- name: Odin internals tests
231261
shell: cmd
232262
run: |
233263
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
234-
odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
264+
odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -sanitize:address
235265
- name: Check issues
236266
shell: cmd
237267
run: |

0 commit comments

Comments
 (0)