-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (174 loc) · 6.3 KB
/
ci.yml
File metadata and controls
197 lines (174 loc) · 6.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
opt: [none, minimal, size, speed, aggressive]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Odin
uses: laytan/setup-odin@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release: dev-2026-03
- name: Build root lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build . -build-mode:lib -vet -strict-style -o:none -debug
else
odin build . -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Build mbox lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./mbox/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./mbox/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Build mpsc lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./mpsc/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./mpsc/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Test mpsc
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./mpsc/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./mpsc/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Build wakeup lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./wakeup/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./wakeup/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Test wakeup
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./wakeup/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./wakeup/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Build loop_mbox lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./loop_mbox/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./loop_mbox/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Build nbio_mbox lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./nbio_mbox/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./nbio_mbox/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Build pool lib
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./pool/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./pool/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Build examples
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin build ./examples/ -build-mode:lib -vet -strict-style -o:none -debug
else
odin build ./examples/ -build-mode:lib -vet -strict-style -o:${{ matrix.opt }}
fi
- name: Test tests
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./tests/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./tests/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Test tests/mbox
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./tests/mbox/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./tests/mbox/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Test tests/loop_mbox
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./tests/loop_mbox/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./tests/loop_mbox/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Test tests/nbio_mbox
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./tests/nbio_mbox/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./tests/nbio_mbox/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Test tests/pool
shell: bash
run: |
if [ "${{ matrix.opt }}" = "none" ]; then
odin test ./tests/pool/ -vet -strict-style -disallow-do -o:none -debug
else
odin test ./tests/pool/ -vet -strict-style -disallow-do -o:${{ matrix.opt }}
fi
- name: Doc smoke test
shell: bash
run: |
odin doc ./
odin doc ./mbox/
odin doc ./mpsc/
odin doc ./wakeup/
odin doc ./loop_mbox/
odin doc ./nbio_mbox/
odin doc ./pool/
odin doc ./examples/
odin doc ./tests/
- name: Generate doc files
if: matrix.os == 'ubuntu-latest' && matrix.opt == 'none'
shell: bash
run: |
mkdir -p doc-out
odin doc ./ > doc-out/mbox.txt
odin doc ./mbox/ > doc-out/mbox_pkg.txt
odin doc ./mpsc/ > doc-out/mpsc.txt
odin doc ./wakeup/ > doc-out/wakeup.txt
odin doc ./loop_mbox/ > doc-out/loop_mbox.txt
odin doc ./nbio_mbox/ > doc-out/nbio_mbox.txt
odin doc ./pool/ > doc-out/pool.txt
odin doc ./examples/ > doc-out/examples.txt
odin doc ./tests/ > doc-out/tests.txt
- name: Upload doc artifact
if: matrix.os == 'ubuntu-latest' && matrix.opt == 'none'
uses: actions/upload-artifact@v4
with:
name: odin-doc
path: doc-out/