-
Notifications
You must be signed in to change notification settings - Fork 2
329 lines (263 loc) · 8.29 KB
/
ci.yml
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
name: Code CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
concurrency:
group: general-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
code-formatting:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
VFLAGS: -cc tcc
steps:
- name: Checkout V
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Build local v
run: make -j4 && sudo ./v symlink
- name: Checkout shy
uses: actions/checkout@v4
with:
path: shy
- name: Test code formatting
run: |
cd shy
v test-fmt
# TODO this makes formatting checks fail?
#- name: Simulate "v install shy"
# run: mv shy ~/.vmodules
- name: Symlink as module
run: sudo ln -s $(pwd)/shy ~/.vmodules/shy # Workaround for doing `mv shy ~/.vmodules`
- name: Build shy with -skip-unused
run: v -skip-unused ~/.vmodules/shy
- name: Build shy
run: v -g ~/.vmodules/shy
- name: Symlink shy command
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy
# TODO broken with $embed_file
#- name: Test clean shy code
# run: |
# shy test-cleancode ~/.vmodules/shy
ubuntu-latest-bootstrap:
runs-on: ubuntu-20.04 # use 20.04 for now (SDL2 compile issue)
timeout-minutes: 20
env:
VFLAGS: -cc tcc -no-retry-compilation
SDL2_VERSION: 2.0.8
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev
sudo apt-get install --quiet -y libsdl2-mixer-dev libsdl2-image-dev
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz
tar -zxvf SDL2.tar.gz
- name: Build SDL
run: |
cd SDL2-${SDL2_VERSION}
mkdir build
cd build
../configure --prefix /tmp/sdl2-${SDL2_VERSION}
make
make install
- name: Checkout V
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Build local v
run: make -j4 && sudo ./v symlink
- name: Install sdl module
run: v install sdl
- name: Checkout shy
uses: actions/checkout@v4
with:
path: shy
- name: Simulate "v install shy"
run: mv shy ~/.vmodules
- name: Run tests
run: v test ~/.vmodules/shy
- name: Build shy with -prod
run: v -prod ~/.vmodules/shy
- name: Build shy
run: v -g ~/.vmodules/shy
- name: Symlink shy
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy
- name: Run 'shy --help'
run: shy --help
- name: Run 'shy doctor'
run: shy doctor
- name: Test shy complete
run: |
[ "$(shy complete bash shy com)" = "COMPREPLY+=('complete')" ]
- name: Build shy example
run: |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)"
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)"
v -d sdl_no_compile_flags ~/.vmodules/shy/examples/hello_world
ubuntu-latest-shy-can-live-anywhere:
runs-on: ubuntu-20.04 # use 20.04 for now
timeout-minutes: 10
env:
VFLAGS: -cc tcc -no-retry-compilation
SDL2_VERSION: 2.0.8
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz
tar -zxvf SDL2.tar.gz
- name: Build SDL
run: |
cd SDL2-${SDL2_VERSION}
mkdir build
cd build
../configure --prefix /tmp/sdl2-${SDL2_VERSION}
make
make install
- name: Checkout V
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Build local v
run: make && sudo ./v symlink
- name: Install sdl module
run: v install sdl
- name: Checkout shy
uses: actions/checkout@v4
with:
path: shy
- name: Simulate "v install shy"
run: mv shy ~/.vmodules
- name: Run tests
run: v test ~/.vmodules/shy
- name: Build shy
run: v -g ~/.vmodules/shy
- name: Move shy
run: |
sudo mv ~/.vmodules/shy/shy /usr/bin/shy
- name: Run 'shy --help'
run: /usr/bin/shy --help
- name: Run 'shy doctor'
run: /usr/bin/shy doctor
- name: Build shy example
run: |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)"
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)"
v -d sdl_no_compile_flags ~/.vmodules/shy/examples/hello_world
ubuntu-latest-build:
runs-on: ubuntu-latest # use 20.04 for now (SDL2 compile issue)
timeout-minutes: 20
env:
VFLAGS: -cc tcc -no-retry-compilation
SDL2_VERSION: 2.0.10
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz
tar -zxvf SDL2.tar.gz
- name: Build SDL
run: |
cd SDL2-${SDL2_VERSION}
mkdir build
cd build
../configure --prefix /tmp/sdl2-${SDL2_VERSION}
make
make install
- name: Checkout V
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Build local v
run: make && sudo ./v symlink
- name: Install sdl module
run: v install sdl
- name: Checkout shy
uses: actions/checkout@v4
with:
path: shy
- name: Simulate "v install shy"
run: mv shy ~/.vmodules
- name: Build shy
run: v -g ~/.vmodules/shy
- name: Symlink shy
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy
- name: Run 'shy --help'
run: shy --help
- name: Run 'shy doctor'
run: shy doctor
- name: Build shy examples
run: |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)"
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)"
v -d sdl_no_compile_flags -skip-unused should-compile-all ~/.vmodules/shy/examples
v -d sdl_no_compile_flags -d shy_analyse should-compile-all ~/.vmodules/shy/examples
v -d sdl_no_compile_flags -d shy_vet should-compile-all ~/.vmodules/shy/examples
sdl-branch-versions:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
sdl-version: [2.0.9, 2.0.10, 2.0.12, 2.0.14, 2.0.16, 2.0.18, 2.0.20, 2.0.22, 2.24.0, 2.26.0, 2.28.0, 2.30.0]
timeout-minutes: 20
env:
VFLAGS: -cc tcc -no-retry-compilation
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y mesa-common-dev
curl -L https://www.libsdl.org/release/SDL2-${{ matrix.sdl-version }}.tar.gz -o SDL2.tar.gz
tar -zxvf SDL2.tar.gz
- name: Build SDL
run: |
cd SDL2-${{ matrix.sdl-version }}
mkdir build
cd build
../configure
make
sudo make install
- name: Checkout V
uses: actions/checkout@v4
with:
repository: vlang/v
- name: Build local v
run: make && sudo ./v symlink
- name: Checkout SDL ${{ matrix.sdl-version }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.sdl-version }}
repository: vlang/sdl
path: sdl
- name: Simulate "v install sdl"
run: |
mkdir -p ~/.vmodules
mv sdl ~/.vmodules
- name: Checkout shy
uses: actions/checkout@v4
with:
path: shy
- name: Simulate "v install shy"
run: mv shy ~/.vmodules
- name: Build shy
run: v -g ~/.vmodules/shy
- name: Symlink shy
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy
- name: Run 'shy --help'
run: shy --help
- name: Run 'shy doctor'
run: shy doctor
- name: Build shy examples
run: |
v -d sdl_no_compile_flags -skip-unused should-compile-all ~/.vmodules/shy/examples
v -d sdl_no_compile_flags -d shy_analyse should-compile-all ~/.vmodules/shy/examples
v -d sdl_no_compile_flags -d shy_vet should-compile-all ~/.vmodules/shy/examples