name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
test:
name: fmt · clippy · test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
- name: Build release
run: cargo build --release
repro:
name: reproducibility · published command on a clean checkout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run the command published on nlj.dev
shell: bash run: cargo run --quiet -- ecosystem | tee ecosystem_report.txt
- name: Output must match the figures the site quotes
run: diff -u tests/golden/ecosystem_report.txt ecosystem_report.txt
- if: always()
uses: actions/upload-artifact@v4
with:
name: ecosystem-report
path: ecosystem_report.txt
if-no-files-found: error
audit:
name: supply chain · cargo audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}