fix: Allow cargo to use cached packages #704
This file contains hidden or 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: Rust CI | |
on: | |
pull_request: | |
branches: [ "master" ] | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
concurrency: | |
group: ci-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
formatting_and_security: | |
name: Formatting and Security | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install Rust nightly | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run Clippy | |
run: cargo clippy --all-targets -- -D warnings | |
- name: Install cargo-audit | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-audit | |
- name: Run Cargo Audit | |
run: cargo audit | |
test: | |
name: Run Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-14 | |
target: aarch64-apple-darwin | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install Rust nightly | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-nextest | |
- name: Run Tests | |
run: cargo nextest run --target ${{ matrix.target }} --all-targets --all-features -E "not kind(bench)" |