Bump actions/cache from 3 to 4 #856
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
# Largely inspired by https://github.com/dtolnay/syn/blob/master/.github/workflows/ci.yml under MIT OR Apache-2.0. | |
name: CI | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
# This used to also be scheduled, but apparently GitHub also turns it off otherwise when deactivating that due to repository inactivity. | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/[email protected] | |
- run: cat CI.toml >> Cargo.toml | |
- run: cargo test --workspace --locked --no-default-features | |
- run: cargo test --workspace --locked | |
- run: cargo test --workspace --locked --all-features | |
# Test the main crate separately, since the examples pull in features. | |
- run: cargo test --locked --no-default-features | |
- run: cargo test --locked | |
- run: cargo test --locked --all-features | |
browser-test: | |
name: Browser Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: stable | |
profile: minimal | |
target: wasm32-unknown-unknown | |
- run: cargo +stable install wasm-bindgen-cli --vers "^0.2.71" | |
- run: cat CI.toml >> Cargo.toml | |
- run: cargo +stable test --locked --target wasm32-unknown-unknown --no-default-features | |
- run: cargo +stable test --locked --target wasm32-unknown-unknown | |
- run: cargo +stable test --locked --target wasm32-unknown-unknown --all-features | |
miri: | |
name: Miri | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: nightly | |
profile: minimal | |
components: miri, rust-src | |
- run: cat CI.toml >> Cargo.toml | |
- run: cargo +nightly miri test --workspace --locked --no-default-features | |
- run: cargo +nightly miri test --workspace --locked | |
- run: cargo +nightly miri test --workspace --locked --all-features | |
check: | |
name: Check on Rust ${{matrix.rust}}${{format(' ({0})', matrix.target || matrix.os)}} | |
runs-on: ${{matrix.os}}-latest | |
strategy: | |
matrix: | |
os: [macos, ubuntu, windows] | |
rust: ['1.58', stable, beta, nightly] | |
env: | |
target: ${{matrix.target && format('--target={0}', matrix.target)}} | |
workspace: ${{matrix.no-workspace || '--workspace'}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: ${{matrix.rust}} | |
profile: minimal | |
target: ${{matrix.target}} | |
- run: cat CI.toml >> Cargo.toml | |
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}} --no-default-features | |
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}} | |
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}} --all-features | |
minimal-versions: | |
name: Minimal Versions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/[email protected] | |
with: | |
toolchain: nightly | |
override: true | |
- uses: taiki-e/install-action@cargo-hack | |
- uses: taiki-e/install-action@cargo-minimal-versions | |
- run: cat CI.toml >> Cargo.toml | |
- run: cargo minimal-versions check --workspace | |
book: | |
name: Book | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
- run: cat CI.toml >> Cargo.toml | |
- run: cd book && cargo run |