Skip to content

Overhaul build cache #329

Overhaul build cache

Overhaul build cache #329

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # makes cache smaller
jobs:
clippy:
name: Clipy and format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check format
run: cargo fmt -- --check
- name: Cache cargo index
uses: actions/cache@v4
with:
key: immutable # this will always be hit because it's a constant
path: ~/.cargo/registry/index
- name: Cache cargo crates
uses: actions/cache@v4
with:
key: crates-${{ hashFiles('Cargo.toml') }} # don't accumulate .crate files of old versions
path: ~/.cargo/registry/cache # target/ dir of clippy is not worth caching
- name: Fetch dependencies
run: cargo fetch
- name: Run clippy
run: cargo clippy --all --all-targets
test:

Check failure on line 41 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 41
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo index and registry
uses: actions/cache@v4
with:
key: immutable
path: ~/.cargo/registry/index
- name: Cache cargo crates
uses: actions/cache@v4
with:
key: crates-${{ hashFiles('Cargo.toml') }} # don't accumulate .crate files of old versions
path: ~/.cargo/registry/cache
- name: Fetch dependencies
run: cargo fetch
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: target-${{ hashFiles('Cargo.toml') }}
- name: Run Rust tests
run: scripts/test.sh