The docker-labeled runner's image is node:20-bookworm, needed for the checkout/cache actions (both Node-based). Overriding it with container: rust:1-bookworm dropped Node from the image entirely, so checkout failed with "node: executable file not found in $PATH". The rust-ci label (see sporah's workflow) points at a custom image with both Rust and Node preinstalled, avoiding the conflict.
34 lines
674 B
YAML
34 lines
674 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: rust-ci
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Cache cargo registry and build artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: |
|
|
cargo-${{ runner.os }}-
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt -- --check
|
|
|
|
- name: Lint
|
|
run: cargo clippy --all-targets -- -D warnings
|
|
|
|
- name: Build
|
|
run: cargo build
|
|
|
|
- name: Test
|
|
run: cargo test
|