-
-
Notifications
You must be signed in to change notification settings - Fork 81
280 lines (234 loc) · 7.76 KB
/
nightly.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
name: Continuous Build
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 5 * * *' # run at 5 AM UTC
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-image-dev libwebp-dev
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: SDL version
run: sdl2-config --version
- name: Build Example
run: zig build install
# Skipped on Ubuntu as it doesn't have SDL2.0.18 yet
# - name: Run tests
# run: zig build test
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install dependencies
run: brew install sdl2 sdl2_image sdl2_ttf harfbuzz graphite2
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: Build Examples
run: zig build install
- name: Run tests
run: zig build test
build-windows-dynamic:
strategy:
fail-fast: false
matrix:
target: [
x86-windows-gnu,
x86_64-windows-gnu,
# x86-windows-msvc, # disabled for now as it seems like zig detects the wrong files
x86_64-windows-msvc,
]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: Install VisualStudio (x86)
if: ${{ matrix.target == 'x86-windows-msvc' }}
uses: ilammy/msvc-dev-cmd@v1
with:
uwp: false
arch: amd64_x86 # cross-compile from amd64 to x86
- name: Install VisualStudio (x64)
if: ${{ matrix.target == 'x86_64-windows-msvc' }}
uses: ilammy/msvc-dev-cmd@v1
with:
uwp: false
arch: x64
- name: Download SDL2 (MinGW)
uses: carlosperate/[email protected]
if: ${{ matrix.target == 'x86-windows-gnu' || matrix.target == 'x86_64-windows-gnu' }}
with:
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz
file-name: SDL2.tar.gz
location: .
- name: Download SDL2 (Visual Studio)
uses: carlosperate/[email protected]
if: ${{ matrix.target == 'x86-windows-msvc' || matrix.target == 'x86_64-windows-msvc' }}
with:
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip
file-name: SDL2.tar.gz
location: .
- name: Extract SDL2
uses: brunoborges/justextract@v1
with:
file: SDL2.tar.gz
- name: Create SDK file
uses: DamianReeves/[email protected]
with:
path: .build_config/sdl.json
contents: |
{
"x86-windows-gnu": {
"include": "SDL2-2.0.18/i686-w64-mingw32/include",
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib",
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin"
},
"x86_64-windows-gnu": {
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include",
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib",
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin"
},
"x86-windows-msvc": {
"include": "SDL2-2.0.18/include",
"libs": "SDL2-2.0.18/lib/x86",
"bin": "SDL2-2.0.18/lib/x86"
},
"x86_64-windows-msvc": {
"include": "SDL2-2.0.18/include",
"libs": "SDL2-2.0.18/lib/x64",
"bin": "SDL2-2.0.18/lib/x64"
}
}
write-mode: overwrite
- name: Build
run: zig build -Dtarget=${{matrix.target}} -Dlink=dynamic
build-windows-static:
strategy:
fail-fast: false
matrix:
target: [x86-windows-gnu, x86_64-windows-gnu]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: Download SDL2 (MinGW)
uses: carlosperate/[email protected]
with:
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz
file-name: SDL2.tar.gz
location: .
- name: Extract SDL2
uses: brunoborges/justextract@v1
with:
file: SDL2.tar.gz
- name: Create SDK file
uses: DamianReeves/[email protected]
with:
path: .build_config/sdl.json
contents: |
{
"x86-windows-gnu": {
"include": "SDL2-2.0.18/i686-w64-mingw32/include",
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib",
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin"
},
"x86_64-windows-gnu": {
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include",
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib",
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin"
}
}
write-mode: overwrite
- name: Build
run: zig build -Dtarget=${{matrix.target}} -Dlink=static
build-cross-windows:
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest]
target: [x86-windows-gnu, x86_64-windows-gnu]
linkage: [static, dynamic]
runs-on: ${{matrix.host}}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: Download SDL2 (MinGW)
uses: carlosperate/[email protected]
with:
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz
file-name: SDL2.tar.gz
location: .
- name: Extract SDL2
uses: brunoborges/justextract@v1
with:
file: SDL2.tar.gz
- name: Create SDK file
uses: DamianReeves/[email protected]
with:
path: .build_config/sdl.json
contents: |
{
"x86-windows-gnu": {
"include": "SDL2-2.0.18/i686-w64-mingw32/include",
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib",
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin"
},
"x86_64-windows-gnu": {
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include",
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib",
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin"
}
}
write-mode: overwrite
- name: Build
run: zig build -Dskip-test -Dtarget=${{matrix.target}} -Dlink=${{matrix.linkage}}
build-cross-linux:
strategy:
fail-fast: false
matrix:
host: [ubuntu-latest, macos-latest, windows-latest]
target: [x86_64-linux-gnu, aarch64-linux-gnu]
runs-on: ${{matrix.host}}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: master
- name: Build
run: zig build -Dskip-test -Dtarget=${{matrix.target}} --verbose
# This would not be a cross-compilation process, thus we must skip it
if: ${{ matrix.host != 'ubuntu-latest' && matrix.target == 'x86_64-linux-gnu' }}