@@ -153,32 +153,44 @@ jobs:
153
153
uses : actions/download-artifact@v1
154
154
with :
155
155
name : macos-installable
156
- - name : Build hello.wasm
157
- shell : bash
156
+ - name : Unpack toolchain
158
157
run : |
159
158
set -x
160
159
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
161
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
160
+ echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
161
+ - name : Build hello.wasm
162
+ shell : bash
163
+ run : |
162
164
echo 'print("Hello, world!")' > hello.swift
163
- $TOOLCHAIN_PATH /usr/bin/swiftc \
165
+ $TOOLCHAIN /usr/bin/swiftc \
164
166
-target wasm32-unknown-wasi \
165
- -sdk $TOOLCHAIN_PATH /usr/share/wasi-sysroot \
167
+ -sdk $TOOLCHAIN /usr/share/wasi-sysroot \
166
168
hello.swift -o hello.wasm && \
167
169
echo "Successfully linked hello.wasm"
168
170
- name : Test SwiftPM
169
171
shell : bash
170
172
run : |
171
173
set -x
172
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
173
174
mkdir test
174
175
cd test
175
- $TOOLCHAIN_PATH /usr/bin/swift package init
176
- $TOOLCHAIN_PATH /usr/bin/swift build --triple wasm32-unknown-wasi
176
+ $TOOLCHAIN /usr/bin/swift package init
177
+ $TOOLCHAIN /usr/bin/swift build --triple wasm32-unknown-wasi
177
178
- name : Upload hello.wasm compiled with macOS package
178
179
uses : actions/upload-artifact@v1
179
180
with :
180
181
name : macos-hello.wasm
181
182
path : hello.wasm
183
+ - name : Checkout integration-tests
184
+ uses : actions/checkout@v2
185
+ with :
186
+ repository : swiftwasm/integration-tests
187
+ path : integration-tests
188
+ ref : release/5.3
189
+ - name : Run integration tests
190
+ run : |
191
+ sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer/
192
+ swift run # Use TOOLCHAIN env value
193
+ working-directory : ${{ github.workspace }}/integration-tests
182
194
183
195
ubuntu1804_smoke_test :
184
196
name : Run smoke tests on Ubuntu 18.04
@@ -189,32 +201,42 @@ jobs:
189
201
uses : actions/download-artifact@v1
190
202
with :
191
203
name : ubuntu18.04-installable
192
- - name : Build hello.wasm
193
- shell : bash
204
+ - name : Unpack toolchain
194
205
run : |
195
206
set -x
196
207
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
197
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
208
+ echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
209
+ - name : Build hello.wasm
210
+ shell : bash
211
+ run : |
198
212
echo 'print("Hello, world!")' > hello.swift
199
- $TOOLCHAIN_PATH /usr/bin/swiftc \
213
+ $TOOLCHAIN /usr/bin/swiftc \
200
214
-target wasm32-unknown-wasi \
201
- -sdk $TOOLCHAIN_PATH /usr/share/wasi-sysroot \
215
+ -sdk $TOOLCHAIN /usr/share/wasi-sysroot \
202
216
hello.swift -o hello.wasm && \
203
217
echo "Successfully linked hello.wasm"
204
218
- name : Test SwiftPM
205
219
shell : bash
206
220
run : |
207
221
set -x
208
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
209
222
mkdir test
210
223
cd test
211
- $TOOLCHAIN_PATH /usr/bin/swift package init
212
- $TOOLCHAIN_PATH /usr/bin/swift build --triple wasm32-unknown-wasi
224
+ $TOOLCHAIN /usr/bin/swift package init
225
+ $TOOLCHAIN /usr/bin/swift build --triple wasm32-unknown-wasi
213
226
- name : Upload hello.wasm compiled with Ubuntu 18.04 package
214
227
uses : actions/upload-artifact@v1
215
228
with :
216
229
name : ubuntu18.04-hello.wasm
217
230
path : hello.wasm
231
+ - name : Checkout integration-tests
232
+ uses : actions/checkout@v2
233
+ with :
234
+ repository : swiftwasm/integration-tests
235
+ path : integration-tests
236
+ ref : release/5.3
237
+ - name : Run integration tests
238
+ run : swift run # Use TOOLCHAIN env value
239
+ working-directory : ${{ github.workspace }}/integration-tests
218
240
219
241
ubuntu2004_smoke_test :
220
242
name : Run smoke tests on Ubuntu 20.04
@@ -225,29 +247,39 @@ jobs:
225
247
uses : actions/download-artifact@v1
226
248
with :
227
249
name : ubuntu20.04-installable
228
- - name : Build hello.wasm
229
- shell : bash
250
+ - name : Unpack toolchain
230
251
run : |
231
252
set -x
232
253
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
233
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
254
+ echo "TOOLCHAIN=$(find "$PWD" -name "swift-wasm-*" -type d)" >> $GITHUB_ENV
255
+ - name : Build hello.wasm
256
+ shell : bash
257
+ run : |
234
258
echo 'print("Hello, world!")' > hello.swift
235
- $TOOLCHAIN_PATH /usr/bin/swiftc \
259
+ $TOOLCHAIN /usr/bin/swiftc \
236
260
-target wasm32-unknown-wasi \
237
- -sdk $TOOLCHAIN_PATH /usr/share/wasi-sysroot \
261
+ -sdk $TOOLCHAIN /usr/share/wasi-sysroot \
238
262
hello.swift -o hello.wasm && \
239
263
echo "Successfully linked hello.wasm"
240
264
- name : Test SwiftPM
241
265
shell : bash
242
266
run : |
243
267
set -x
244
- TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
245
268
mkdir test
246
269
cd test
247
- $TOOLCHAIN_PATH /usr/bin/swift package init
248
- $TOOLCHAIN_PATH /usr/bin/swift build --triple wasm32-unknown-wasi
270
+ $TOOLCHAIN /usr/bin/swift package init
271
+ $TOOLCHAIN /usr/bin/swift build --triple wasm32-unknown-wasi
249
272
- name : Upload hello.wasm compiled with Ubuntu 20.04 package
250
273
uses : actions/upload-artifact@v1
251
274
with :
252
275
name : ubuntu20.04-hello.wasm
253
276
path : hello.wasm
277
+ - name : Checkout integration-tests
278
+ uses : actions/checkout@v2
279
+ with :
280
+ repository : swiftwasm/integration-tests
281
+ path : integration-tests
282
+ ref : release/5.3
283
+ - name : Run integration tests
284
+ run : swift run # Use TOOLCHAIN env value
285
+ working-directory : ${{ github.workspace }}/integration-tests
0 commit comments