Skip to content

Commit 5280af3

Browse files
committed
ci: enable test for wasm-wasip1 target
Signed-off-by: Master-Hash <[email protected]>
1 parent 4219836 commit 5280af3

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ rustflags = [
44
"-Clink-arg=-lc++",
55
"-Clink-arg=-lc++abi"
66
]
7+
runner = "wasmtime run"

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- { target: aarch64-pc-windows-msvc, os: windows-11-arm }
1717

1818
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04, use-cross: true }
19+
- { target: wasm32-wasip1, os: ubuntu-24.04 }
1920

2021
# mac-14 is an M1 ARM device.
2122
- { target: aarch64-apple-darwin, os: macos-14 }
@@ -35,13 +36,22 @@ jobs:
3536
uses: dtolnay/[email protected]
3637
with:
3738
targets: ${{ matrix.job.target }}
39+
if: ${{ matrix.job.target != 'wasm32-wasip1' }}
3840

3941
- name: Install cross
4042
if: matrix.job.use-cross
4143
uses: taiki-e/install-action@v2
4244
with:
4345
4446

47+
- if: ${{ matrix.job.target == 'wasm32-wasip1' }}
48+
run: |
49+
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-x86_64-linux.deb
50+
sudo apt-get install ./wasi-sdk-29.0-x86_64-linux.deb
51+
rm ./wasi-sdk-29.0-x86_64-linux.deb
52+
rustup override set stable
53+
rustup target add wasm32-wasip1
54+
4555
- name: Overwrite build command env variable
4656
if: matrix.job.use-cross
4757
shell: bash
@@ -50,6 +60,12 @@ jobs:
5060
- name: Test
5161
shell: bash
5262
run: $BUILD_CMD $SUBCOMMAND --target ${{ matrix.job.target }}
63+
env:
64+
WASI_SDK_PATH: /opt/wasi-sdk
65+
WASI_SYSROOT: /opt/wasi-sdk/share/wasi-sysroot
66+
CC_wasm32_wasip1: /opt/wasi-sdk/bin/clang
67+
AR_wasm32_wasip1: /opt/wasi-sdk/bin/llvm-ar
68+
CFLAGS_wasm32_wasip1: "--sysroot=/opt/wasi-sdk/share/wasi-sysroot"
5369

5470
test_mime_db:
5571
name: Test with MIME database

0 commit comments

Comments
 (0)