Build & Test #746
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: Build & Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# runs the CI everyday at 10AM | |
- cron: "0 10 * * *" | |
jobs: | |
build_and_test: | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
toolchain: ["stable", "nightly"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: rustfmt, clippy | |
- name: Check format | |
run: cargo fmt --all --check | |
- name: Code analysis (--no-default-features) | |
run: cargo clippy --workspace --no-default-features -- -D warnings | |
- name: Code analysis (--all-targets --all-features) | |
if: matrix.toolchain == 'nightly' # experimental-api requires nightly | |
run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
- name: Run tests (--no-default-features) | |
run: cargo test --workspace --no-default-features | |
- name: Run tests (--all-features) | |
if: matrix.toolchain == 'nightly' # experimental-api requires nightly | |
run: cargo test --workspace --all-features | |
- name: Run tests under WASI | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
rustup target add wasm32-wasi | |
brew install wasmer | |
CARGO_TARGET_WASM32_WASI_RUNNER="wasmer" cargo test --target="wasm32-wasi" --package=rearch |