6
6
on :
7
7
push :
8
8
branches :
9
- - ' master'
10
- - ' staging'
11
- - ' trying'
9
+ - ' **'
10
+ # - 'master'
11
+ # - 'staging'
12
+ # - 'trying'
12
13
tags :
13
14
# this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
14
15
- ' [0-9]+.[0-9]+.[0-9]+*'
38
39
strategy :
39
40
fail-fast : false
40
41
matrix :
41
- build : [linux-x64, macos-x64, macos-arm64, windows-x64, linux-aarch64]
42
42
include :
43
43
- build : linux-x64
44
44
os : ubuntu-18.04
@@ -77,14 +77,15 @@ jobs:
77
77
CARGO_SCCACHE_VERSION : 0.2.14-alpha.0-parity
78
78
SCCACHE_AZURE_BLOB_CONTAINER : wasmerstoragesccacheblob
79
79
SCCACHE_AZURE_CONNECTION_STRING : ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }}
80
+ TARGET : ${{ matrix.target }}
80
81
steps :
81
82
- uses : actions/checkout@v2
82
83
- name : Set up libstdc++ on Linux
84
+ if : matrix.build == 'linux-x64'
83
85
run : |
84
86
sudo apt-get update -y
85
87
sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04
86
88
sudo apt-get install --reinstall g++-8
87
- if : matrix.os == 'ubuntu-18.04'
88
89
- name : Install Rust ${{ matrix.rust }}
89
90
uses : actions-rs/toolchain@v1
90
91
with :
@@ -125,7 +126,6 @@ jobs:
125
126
~/.cargo/registry
126
127
~/.cargo/git
127
128
key : ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1
128
- # Install sccache
129
129
- uses : actions/cache@v2
130
130
with :
131
131
path : ${{ runner.tool_cache }}/cargo-sccache
@@ -172,7 +172,7 @@ jobs:
172
172
- name : Test
173
173
run : |
174
174
make test
175
- if : matrix.target != 'aarch64-apple-darwin '
175
+ if : matrix.build != 'macos-arm64 '
176
176
- name : Test C API
177
177
run : |
178
178
make test-capi
@@ -189,9 +189,9 @@ jobs:
189
189
run : |
190
190
make build-wasmer
191
191
- name : Build Wapm binary
192
+ if : needs.setup.outputs.DOING_RELEASE == '1'
192
193
run : |
193
194
make build-wapm
194
- if : needs.setup.outputs.DOING_RELEASE == '1'
195
195
- name : Install Nightly Rust for Headless
196
196
uses : actions-rs/toolchain@v1
197
197
with :
@@ -201,6 +201,7 @@ jobs:
201
201
components : " rust-src"
202
202
if : needs.setup.outputs.DOING_RELEASE == '1'
203
203
- name : Build Minimal Wasmer Headless
204
+ if : needs.setup.outputs.DOING_RELEASE == '1'
204
205
run : |
205
206
cargo install xargo
206
207
echo "" >> Cargo.toml
@@ -215,12 +216,13 @@ jobs:
215
216
echo "codegen-units = 1" >> Cargo.toml
216
217
echo "rpath = false" >> Cargo.toml
217
218
make build-wasmer-headless-minimal
218
- if : needs.setup.outputs.DOING_RELEASE == '1'
219
219
- name : Copy target binaries
220
220
run : |
221
221
mkdir -p target/release
222
222
cp target/${{matrix.target}}/release/wasmer* target/release
223
- cp target/${{matrix.target}}/release/libwasmer* target/release
223
+ if find target/${{matrix.target}}/release -type f -name 'libwasmer*' -maxdepth 1 | grep -q "."; then
224
+ cp target/${{matrix.target}}/release/libwasmer* target/release
225
+ fi
224
226
if [ -d "wapm-cli" ]; then
225
227
mkdir -p wapm-cli/target/release
226
228
cp wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
@@ -242,7 +244,7 @@ jobs:
242
244
make test-integration
243
245
if : matrix.run_integration_tests && matrix.os != 'windows-latest'
244
246
- name : Cross compile from Linux
245
- if : matrix.os == 'ubuntu-18.04 '
247
+ if : matrix.build == 'linux-x64 '
246
248
shell : bash
247
249
run : |
248
250
ls target/release
@@ -289,6 +291,71 @@ jobs:
289
291
if-no-files-found : error
290
292
retention-days : 1
291
293
294
+ test-docker :
295
+ name : Test on ${{ matrix.build }}
296
+ runs-on : ubuntu-latest
297
+ needs : setup
298
+ strategy :
299
+ fail-fast : false
300
+ matrix :
301
+ include :
302
+ - build : linux-musl-x64
303
+ image : alpine:latest
304
+ rust : 1.48
305
+ artifact_name : ' wasmer-linux-musl-amd64'
306
+ steps :
307
+ - uses : actions/checkout@v2
308
+
309
+ - uses : addnab/docker-run-action@v1
310
+ with :
311
+ image : ${{ matrix.image }}
312
+ options : -v ${{ github.workspace }}:/work
313
+ run : |
314
+ # Set up tools
315
+ apk add musl-dev curl make libtool libffi-dev gcc automake autoconf
316
+
317
+ # Install Rust ${{ matrix.rust }}
318
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
319
+ sh ./rustup.sh -y
320
+ source ~/.cargo/env
321
+ rm -f ./rustup.sh
322
+
323
+ # Change working directory
324
+ cd /work
325
+
326
+ # Inspect
327
+ pwd
328
+ ls -lha
329
+
330
+ # Test
331
+ make test
332
+
333
+ # Test C API
334
+ make test-capi
335
+
336
+ # Build C API
337
+ make build-capi
338
+
339
+ # Build Wasmer binary
340
+ make build-wasmer
341
+
342
+ # Build Wapm binary
343
+ make build-wapm
344
+
345
+ # Dist
346
+ make distribution
347
+
348
+ # Run integration tests
349
+ export WASMER_DIR=`pwd`/package
350
+ make test-integration
351
+ - name : Upload Artifacts
352
+ uses : actions/upload-artifact@v2
353
+ with :
354
+ name : ${{ matrix.artifact_name }}
355
+ path : dist
356
+ if-no-files-found : error
357
+ retention-days : 1
358
+
292
359
test-cross-compile-on-linux :
293
360
name : Test cross-compile on linux
294
361
needs : [setup, test]
@@ -347,7 +414,6 @@ jobs:
347
414
uses : actions/download-artifact@v2
348
415
with :
349
416
path : artifacts
350
-
351
417
- name : Create Release
352
418
id : create_release
353
419
uses : actions/create-release@v1
@@ -358,7 +424,6 @@ jobs:
358
424
release_name : Release ${{ needs.setup.outputs.VERSION }}
359
425
draft : true
360
426
prerelease : false
361
-
362
427
- name : Upload Release Asset Windows Installer
363
428
uses : actions/upload-release-asset@v1
364
429
env :
@@ -368,7 +433,6 @@ jobs:
368
433
asset_path : artifacts/wasmer-windows-amd64/WasmerInstaller.exe
369
434
asset_name : wasmer-windows.exe
370
435
asset_content_type : application/vnd.microsoft.portable-executable
371
-
372
436
- name : Upload Release Asset Windows
373
437
uses : actions/upload-release-asset@v1
374
438
env :
@@ -378,7 +442,6 @@ jobs:
378
442
asset_path : artifacts/wasmer-windows-amd64/wasmer.tar.gz
379
443
asset_name : wasmer-windows-amd64.tar.gz
380
444
asset_content_type : application/gzip
381
-
382
445
- name : Upload Release Asset Linux amd64
383
446
uses : actions/upload-release-asset@v1
384
447
env :
@@ -388,7 +451,16 @@ jobs:
388
451
asset_path : artifacts/wasmer-linux-amd64/wasmer.tar.gz
389
452
asset_name : wasmer-linux-amd64.tar.gz
390
453
asset_content_type : application/gzip
391
-
454
+ - name : Upload Release Asset Linux amd64 (musl)
455
+ id : upload-release-asset-linux-musl-amd64
456
+ uses : actions/upload-release-asset@v1
457
+ env :
458
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
459
+ with :
460
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
461
+ asset_path : artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz
462
+ asset_name : wasmer-linux-musl-amd64.tar.gz
463
+ asset_content_type : application/gzip
392
464
- name : Upload Release Asset Mac amd64
393
465
uses : actions/upload-release-asset@v1
394
466
env :
0 commit comments