-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (84 loc) · 3.3 KB
/
ci.yml
File metadata and controls
89 lines (84 loc) · 3.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
name: CI
on: [push, pull_request]
jobs:
test-software:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & test (software backend)
run: |
for t in test_arena test_math test_layout test_gfx test_runtime test_font; do
clang -I include -I tools -Wall -Wextra -Wpedantic -Wshadow \
tests/${t}.c -lm -o /tmp/$t && /tmp/$t
done
- name: Build stock_dashboard + PPM output
run: |
clang -O3 -DSC_GFX_IMPLEMENTATION -DSC_LAYOUT_IMPLEMENTATION \
-DSC_WIDGET_IMPLEMENTATION -DSC_RUNTIME_IMPLEMENTATION \
-DSC_FONT_IMPLEMENTATION -DSC_GFX_BACKEND_SOFTWARE \
-I include -I tools apps/stock_dashboard/stock_dashboard.c \
-lm -o /tmp/stock_dashboard
/tmp/stock_dashboard
file silvercore.ppm
test-vulkan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Vulkan SDK
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libvulkan-dev mesa-vulkan-drivers
- name: Compile Vulkan backend
run: |
clang -I include -I tools -DSC_GFX_IMPLEMENTATION \
-DSC_GFX_BACKEND_VULKAN -DSC_BACKEND_VULKAN_IMPLEMENTATION \
-DSC_LAYOUT_IMPLEMENTATION -DSC_WIDGET_IMPLEMENTATION \
-DSC_RUNTIME_IMPLEMENTATION -DSC_FONT_IMPLEMENTATION \
-x c -c backends/sc_backend_vulkan.h -o /dev/null \
-Wall -Wextra -Wpedantic -Wshadow
- name: Build and run Vulkan headless test
run: |
clang -I include -I tools -I backends \
-DSC_GFX_BACKEND_VULKAN -DSC_BACKEND_VULKAN_IMPLEMENTATION \
-DSC_LAYOUT_IMPLEMENTATION -DSC_WIDGET_IMPLEMENTATION \
-DSC_RUNTIME_IMPLEMENTATION -DSC_FONT_IMPLEMENTATION \
-Wall -Wextra -Wpedantic -Wshadow \
-x c backends/sc_backend_vulkan.h tests/test_gfx.c \
-lm -lvulkan -o /tmp/test_vk
/tmp/test_vk
test-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & test with AddressSanitizer
run: |
for t in test_arena test_math test_layout test_gfx test_runtime test_font; do
clang -I include -I tools -Wall -Wextra -Wpedantic -Wshadow \
-fsanitize=address -fno-omit-frame-pointer \
tests/${t}.c -lm -o /tmp/$t && /tmp/$t
done
test-ubsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & test with UndefinedBehaviorSanitizer
run: |
for t in test_arena test_math test_layout test_gfx test_runtime test_font; do
clang -I include -I tools -Wall -Wextra -Wpedantic -Wshadow \
-fsanitize=undefined -fno-sanitize-recover=undefined \
tests/${t}.c -lm -o /tmp/$t && /tmp/$t
done
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.64
- name: Build WASM target
run: |
emcmake cmake -S . -B build-wasm -DWASM=ON -DSC_TESTS=OFF -DSC_SHARED=OFF
cmake --build build-wasm -j$(nproc)
- name: Verify WASM output
run: |
ls -lh build-wasm/*.wasm build-wasm/*.js