test: make tests work on more targets #227
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build-wasm: | |
name: Build wasm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Rust toolchain & Binaryen | |
run: rustup update && rustup target add wasm32-unknown-unknown && sudo apt-get install -y binaryen wabt | |
- name: Build wasm | |
run: ./examples/rust/build.sh | |
- name: Save artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wasm | |
path: examples/rust/out | |
test-std: | |
needs: build-wasm | |
name: Test with default features on stable Rust | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install latest stable Rust toolchain | |
run: rustup update stable | |
- name: Load wasm | |
uses: actions/download-artifact@v4 | |
with: | |
name: wasm | |
path: examples/rust/out | |
- name: Build (stable) | |
run: cargo +stable build --workspace | |
- name: Run tests (stable) | |
run: cargo +stable test --workspace | |
- name: Run MVP testsuite | |
run: cargo +stable test-mvp | |
test-no-std: | |
needs: build-wasm | |
name: Test without default features on nightly Rust | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install latest nightly Rust toolchain | |
run: rustup update nightly | |
- name: Load wasm | |
uses: actions/download-artifact@v4 | |
with: | |
name: wasm | |
path: examples/rust/out | |
- name: Build (nightly, no default features) | |
run: cargo +nightly build --workspace --no-default-features | |
- name: Run tests (nightly, no default features) | |
run: cargo +nightly test --workspace --no-default-features | |
- name: Run MVP testsuite (nightly) | |
run: cargo +nightly test-mvp | |
test-m1: | |
needs: build-wasm | |
name: Test on arm64 (Apple M1) | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install stable Rust toolchain | |
run: rustup update stable | |
- name: Load wasm | |
uses: actions/download-artifact@v4 | |
with: | |
name: wasm | |
path: examples/rust/out | |
- name: Build (stable) | |
run: cargo +stable build | |
- name: Run tests (stable) | |
run: cargo +stable test | |
- name: Run MVP testsuite | |
run: cargo +stable test-mvp | |
test-armv7: | |
needs: build-wasm | |
name: Test on armv7 (32-Bit Raspberry Pi) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Load wasm | |
uses: actions/download-artifact@v4 | |
with: | |
name: wasm | |
path: examples/rust/out | |
- name: Run all tests (for the default workspace members) | |
uses: houseabsolute/actions-rust-cross@v0.0.12 | |
with: | |
command: test | |
target: armv7-unknown-linux-gnueabihf | |
toolchain: nightly | |
- name: Run MVP testsuite | |
uses: houseabsolute/actions-rust-cross@v0.0.12 | |
with: | |
command: test | |
args: "-p tinywasm --test test-mvp --release -- --enable" | |
target: armv7-unknown-linux-gnueabihf | |
toolchain: nightly |