Skip to content

ci-wasm

ci-wasm #1301

Workflow file for this run

name: ci-wasm
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "17 3 * * *"
env:
CARGO_TERM_COLOR: always
INLINE_IGNORE_PATTERN: "drop_in_place|::fmt::"
jobs:
test-wasm32-wasip1:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: wasm32-wasip1
- name: Setup Wasmer
uses: wasmerio/[email protected]
- name: Install WASM Runner
run: cargo install wasm-runner
- name: Run tests
run: |
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
for rustflags in "" "-C target-feature=+simd128"; do
cargo clean; RUSTFLAGS=$rustflags cargo test --no-default-features $features --target wasm32-wasip1 --all-targets --verbose
done
done
env:
CARGO_TARGET_WASM32_WASIP1_RUNNER: wasm-runner wasmer
WASM_RUNNER_VERBOSE: 1
test-inlining-wasm32:
runs-on: macos-latest
defaults:
run:
working-directory: inlining
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
targets: "wasm32-wasip1,wasm32-unknown-unknown"
components: "llvm-tools-preview"
- name: Install rustfilt
run: cargo install rustfilt
- name: Check if the expected fns are inlined
env:
RUSTFLAGS: "-C target-feature=+simd128"
run: |
for target in wasm32-wasip1 wasm32-unknown-unknown; do
./check-inlining.sh $target expected-methods-wasm32-simd128.txt
./check-inlining.sh $target expected-methods-wasm32-simd128.txt --no-default-features
./check-inlining.sh $target expected-methods-wasm32-simd128.txt "--features public_imp"
./check-inlining.sh $target expected-methods-wasm32-simd128.txt "--features public_imp,std"
done
build-wasm32-unknown:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ["1.38.0", stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: wasm32-unknown-unknown
- name: Run build
run: |
for rustflags in "-D warnings" "-D warnings -C target-feature=+simd128"; do
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
cargo clean; RUSTFLAGS=$rustflags cargo build --no-default-features $features --target wasm32-unknown-unknown --verbose
done
done
clippy_check:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings -C target-feature=+simd128"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
targets: wasm32-wasip1, wasm32-unknown-unknown
- name: Clippy
run: |
for target in wasm32-wasip1 wasm32-unknown-unknown; do
for rustflags in "-D warnings" "-D warnings -C target-feature=+simd128"; do
RUSTFLAGS=$rustflags cargo clippy --target $target --all-targets --all-features
RUSTFLAGS=$rustflags cargo clippy --target $target --all-targets --no-default-features
done
done