name: Build
on: [push, pull_request]
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUSTC_WRAPPER: "sccache"
RUSTFLAGS: -D warnings
SCCACHE_GHA_ENABLED: "true"
jobs:
nightly:
name: Nightly
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write checks: write env:
SCCACHE_GHA_CACHE_NAME: "nightly"
steps:
- uses: actions/checkout@v6
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release/deps
target/debug/deps
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Check formatting
run: cargo fmt -- --check
- name: Run Cargo Tests (default features)
run: cargo test
- name: Run Cargo Tests (all features)
run: cargo test --all-features
- name: Run Cargo Tests (no features)
run: cargo test --no-default-features
- name: Clippy Check
uses: giraffate/clippy-action@v1
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
stable:
name: Stable
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
env:
SCCACHE_GHA_CACHE_NAME: "stable"
steps:
- uses: actions/checkout@v6
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release/deps
target/debug/deps
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Check formatting
run: cargo fmt -- --check
- name: Run Cargo Tests (default features)
run: cargo test
- name: Run Cargo Tests (all features)
run: cargo test --all-features
- name: Run Cargo Tests (no features)
run: cargo test --no-default-features
- name: Clippy Check
uses: giraffate/clippy-action@v1
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}