name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
- "renovate/**"
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- 1.70.0 - nightly
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 name: Setup rust toolchain
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 with:
save-if: ${{ github.ref_name == 'main' }}
- name: Build with stable features
run: cargo build --features stable
- name: Build with unstable features
if: ${{ matrix.rust == 'nightly' }}
run: cargo build --all-features
- name: Build with minimal features
run: cargo build --no-default-features
- name: Test with stable features
run: cargo test --features stable
- name: Test with minimal features
run: cargo test --no-default-features
- name: Check codspeed
run: cargo check --features codspeed
- name: Check for non-standard formatting
if: ${{ matrix.rust == 'stable' }}
run: cargo fmt --all -- --check
- name: Check for clippy hints
if: ${{ matrix.rust == 'stable' }}
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test run targeting WASI
if: false run: |
curl https://wasmtime.dev/install.sh -sSf | bash
source ~/.bashrc
export PATH=$HOME/.wasmtime/bin/:$PATH
cargo install cargo-wasi
cargo wasi bench --no-default-features -- --test -- # hack to eliminate the `--bench` argument pass in from `cargo wasi`
nextest-compat:
name: Check compatibility with nextest
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 with:
shared-key: test
save-if: ${{ github.ref_name == 'main' }}
- uses: taiki-e/install-action@1ff94e96eee448734f1060c7332194641ad3a1dd
- run: ci/nextest-compat.sh
unused-deps:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b - uses: oxc-project/setup-rust@3d6fb132fbe7cdcb66bf8ec193911c2945369d12 with:
restore-cache: false
tools: cargo-shear@1
- run: cargo shear