Skip to content

ci: fix github action #260

ci: fix github action

ci: fix github action #260

Workflow file for this run

name: Rust CI
on:
push:
branches: ["**"]
pull_request:
branches: ["next", "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
run-tests:
needs: build-wasm
strategy:
matrix:
include:
- os: ubuntu-latest
rust: stable
name: "Linux (stable)"
- os: ubuntu-latest
rust: nightly
name: "Linux (nightly)"
- os: ubuntu-latest
rust: stable
name: "Linux (stable, no default features)"
args: "--no-default-features"
- os: ubuntu-latest
rust: nightly
name: "Linux (nightly, no default features)"
args: "--no-default-features"
- os: macos-14
rust: stable
name: "macOS arm64 (Apple M1)"
- os: ubuntu-latest
rust: stable
name: "armv7 (32-Bit Raspberry Pi)"
target: armv7-unknown-linux-gnueabihf
name: Run tests on ${{ matrix.os }}, ${{ matrix.name }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
rustflags: ""
components: rustfmt, clippy
if: matrix.target == ''
- name: Load wasm
uses: actions/download-artifact@v4
with:
name: wasm
path: examples/rust/out
- name: Run tests
run: cargo test --workspace ${{ matrix.args }} && cargo run --example wasm-rust all
if: matrix.target == ''
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features
if: matrix.target == ''
- name: Run tests (${{ matrix.target }})
uses: houseabsolute/[email protected]
with:
command: test
target: ${{ matrix.target }}
toolchain: ${{ matrix.rust }}
if: matrix.target != ''
- name: Run clippy (${{ matrix.target }})
uses: houseabsolute/[email protected]
with:
command: clippy
target: ${{ matrix.target }}
toolchain: ${{ matrix.rust }}
if: matrix.target != ''