38
38
strategy :
39
39
fail-fast : false
40
40
matrix :
41
- build : [linux-x64, macos-x64, macos-arm64, windows-x64, linux-aarch64]
42
41
include :
43
42
- build : linux-x64
44
43
os : ubuntu-18.04
47
46
artifact_name : ' wasmer-linux-amd64'
48
47
cross_compilation_artifact_name : ' cross_compiled_from_linux'
49
48
run_integration_tests : true
49
+ - build : linux-musl-x64
50
+ os : ubuntu-18.04
51
+ rust : 1.48
52
+ target : x86_64-unknown-linux-musl
53
+ artifact_name : ' wasmer-linux-musl-amd64'
54
+ cross_compilation_artifact_name : ' cross_compiled_from_linux'
55
+ run_integration_tests : false
50
56
- build : macos-x64
51
57
os : macos-latest
52
58
rust : 1.48
@@ -77,14 +83,20 @@ jobs:
77
83
CARGO_SCCACHE_VERSION : 0.2.14-alpha.0-parity
78
84
SCCACHE_AZURE_BLOB_CONTAINER : wasmerstoragesccacheblob
79
85
SCCACHE_AZURE_CONNECTION_STRING : ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }}
86
+ TARGET : ${{ matrix.target }}
80
87
steps :
81
88
- uses : actions/checkout@v2
82
89
- name : Set up libstdc++ on Linux
90
+ if : matrix.build == 'linux-x64'
83
91
run : |
84
92
sudo apt-get update -y
85
93
sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04
86
94
sudo apt-get install --reinstall g++-8
87
- if : matrix.os == 'ubuntu-18.04'
95
+ - name : Set up musl on Linux
96
+ if : matrix.build == 'linux-musl-x64'
97
+ run : |
98
+ sudo apt-get update -y
99
+ sudo apt-get install -y musl-dev musl-tools
88
100
- name : Install Rust ${{ matrix.rust }}
89
101
uses : actions-rs/toolchain@v1
90
102
with :
@@ -124,7 +136,6 @@ jobs:
124
136
~/.cargo/registry
125
137
~/.cargo/git
126
138
key : ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1
127
- # Install sccache
128
139
- uses : actions/cache@v2
129
140
with :
130
141
path : ${{ runner.tool_cache }}/cargo-sccache
@@ -171,26 +182,43 @@ jobs:
171
182
- name : Test
172
183
run : |
173
184
make test
174
- if : matrix.target != 'aarch64-apple-darwin'
185
+ if : matrix.build != 'macos-arm64' && matrix.build != 'linux-musl-x64'
186
+ - name : Test (musl)
187
+ if : matrix.build == 'linux-musl-x64'
188
+ run : |
189
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make test
175
190
- name : Test C API
176
191
run : |
177
192
make test-capi
178
- if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' # we can't test yet on Apple Silicon or Windows
193
+ if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' && matrix.build != 'linux-musl-x64' # we can't test yet on Apple Silicon or Windows
194
+ - name : Test C API (musl)
195
+ run : |
196
+ LIBC=musl make test-capi
197
+ if : matrix.build == 'linux-musl-x64'
179
198
- name : Build C API
180
199
run : |
181
200
make build-capi
182
- if : matrix.target != 'aarch64-apple-darwin'
201
+ if : matrix.target != 'aarch64-apple-darwin' && matrix.build != 'linux-musl-x64'
183
202
- name : Build C API (system libffi)
184
203
run : |
185
204
make build-capi-cranelift-system-libffi
186
205
if : matrix.target == 'aarch64-apple-darwin'
206
+ - name : Build C API (musl)
207
+ run : |
208
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make build-capi
209
+ if : matrix.build == 'linux-musl-x64'
187
210
- name : Build Wasmer binary
211
+ if : matrix.build != 'linux-musl-x64'
188
212
run : |
189
213
make build-wasmer
214
+ - name : Build Wasmer binary (musl)
215
+ if : matrix.build == 'linux-musl-x64'
216
+ run : |
217
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make build-wasmer
190
218
- name : Build Wapm binary
219
+ if : needs.setup.outputs.DOING_RELEASE == '1' && matrix.build != 'linux-musl-x64'
191
220
run : |
192
221
make build-wapm
193
- if : needs.setup.outputs.DOING_RELEASE == '1'
194
222
- name : Install Nightly Rust for Headless
195
223
uses : actions-rs/toolchain@v1
196
224
with :
@@ -200,6 +228,7 @@ jobs:
200
228
components : " rust-src"
201
229
if : needs.setup.outputs.DOING_RELEASE == '1'
202
230
- name : Build Minimal Wasmer Headless
231
+ if : needs.setup.outputs.DOING_RELEASE == '1' && matrix.build != 'linux-musl-x64'
203
232
run : |
204
233
cargo install xargo
205
234
echo "" >> Cargo.toml
@@ -214,12 +243,13 @@ jobs:
214
243
echo "codegen-units = 1" >> Cargo.toml
215
244
echo "rpath = false" >> Cargo.toml
216
245
make build-wasmer-headless-minimal
217
- if : needs.setup.outputs.DOING_RELEASE == '1'
218
246
- name : Copy target binaries
219
247
run : |
220
248
mkdir -p target/release
221
249
cp target/${{matrix.target}}/release/wasmer* target/release
222
- cp target/${{matrix.target}}/release/libwasmer* target/release
250
+ if find target/${{matrix.target}}/release -type f -name 'libwasmer*' -maxdepth 1 | grep -q "."; then
251
+ cp target/${{matrix.target}}/release/libwasmer* target/release
252
+ fi
223
253
if [ -d "wapm-cli" ]; then
224
254
mkdir -p wapm-cli/target/release
225
255
cp wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
@@ -241,7 +271,7 @@ jobs:
241
271
make test-integration
242
272
if : matrix.run_integration_tests && matrix.os != 'windows-latest'
243
273
- name : Cross compile from Linux
244
- if : matrix.os == 'ubuntu-18.04 '
274
+ if : matrix.build == 'linux-x64 '
245
275
shell : bash
246
276
run : |
247
277
ls target/release
@@ -376,6 +406,16 @@ jobs:
376
406
asset_path : artifacts/wasmer-linux-amd64/wasmer.tar.gz
377
407
asset_name : wasmer-linux-amd64.tar.gz
378
408
asset_content_type : application/gzip
409
+ - name : Upload Release Asset Linux amd64 (musl)
410
+ id : upload-release-asset-linux-musl-amd64
411
+ uses : actions/upload-release-asset@v1
412
+ env :
413
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
414
+ with :
415
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
416
+ asset_path : artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz
417
+ asset_name : wasmer-linux-musl-amd64.tar.gz
418
+ asset_content_type : application/gzip
379
419
- name : Upload Release Asset Mac amd64
380
420
id : upload-release-asset-mac-amd64
381
421
uses : actions/upload-release-asset@v1
0 commit comments