Skip to content

Build & Test

Build & Test #289

Workflow file for this run

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: ["1.76.0", "stable"]
# NOTE: not using --all-features below since the better-api feature requires nightly
# and nightly clippy has some false positives
features: ["--no-default-features", "--features=logging"]
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
run: cargo clippy --workspace ${{ matrix.features }} -- -D warnings
- name: Run tests
run: cargo test --workspace ${{ matrix.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"