Skip to content

Commit 5faea84

Browse files
committed
Run CI tests in wasm as well
Inspired by #41 but hasn't actually found any issues.
1 parent c527a26 commit 5faea84

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/main.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,28 @@ jobs:
1818
rust: stable
1919
- os: windows-latest
2020
rust: stable
21+
- os: ubuntu-latest
22+
rust: stable
23+
target: wasm32-wasip1
2124
steps:
2225
- uses: actions/checkout@v4
23-
- name: Install Rust (
24-
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
26+
- run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
2527
shell: bash
28+
29+
# Configure cross-builds by adding the rustup target and configuring future
30+
# cargo invocations.
31+
- run: |
32+
rustup target add ${{ matrix.target }}
33+
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
34+
if: matrix.target != ''
35+
36+
# For wasm install wasmtime as a test runner and configure it with Cargo.
37+
- name: Setup `wasmtime`
38+
uses: bytecodealliance/actions/wasmtime/setup@v1
39+
if: matrix.target == 'wasm32-wasip1'
40+
- run: echo CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime
41+
if: matrix.target == 'wasm32-wasip1'
42+
2643
- run: cargo test
2744
- run: cargo test --features debug
2845
- run: cargo test --features global

0 commit comments

Comments
 (0)