name: Rust CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
checks:
name: Format, lint, test, and audit
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
- name: Install Rust toolchain
shell: bash
run: scripts/ci_install_rust.sh
- name: Cache Rust build output
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
cache-on-failure: true
key: ${{ runner.os }}-cargo-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}
- name: Install security tools
uses: taiki-e/install-action@fd2f5e3d644b484055ebf4268f474c565f148f25
with:
tool: cargo-deny@0.19.8,cargo-audit@0.22.1,cargo-sbom@0.10.0
- name: Run checks
run: scripts/checks.sh
- name: Generate SBOM
run: scripts/generate-sbom.sh