Real errors are happening now, so don't ignore them #71
This file contains 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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint | |
strategy: | |
matrix: | |
channel: [stable, beta, nightly] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install ${{ matrix.channel }} toolchain | |
run: rustup install ${{ matrix.channel }} | |
- name: Set ${{ matrix.channel }} toolchain as default | |
run: rustup default ${{ matrix.channel }} | |
- name: Install `clippy`, `rustfmt` | |
run: rustup component add clippy rustfmt | |
- name: Populate Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- name: Run `clippy` | |
run: cargo clippy | |
- name: Check formatting | |
run: cargo fmt --check | |
test: | |
needs: lint | |
name: Test | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
channel: [stable, beta, nightly] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install ${{ matrix.channel }} toolchain | |
run: rustup install ${{ matrix.channel }} | |
- name: Set ${{ matrix.channel }} toolchain as default | |
run: rustup default ${{ matrix.channel }} | |
- name: Populate Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- name: Install `cargo-binstall` | |
uses: cargo-bins/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install `cargo-nextest`, `rage`, `just` | |
run: cargo binstall cargo-nextest rage just --secure --no-confirm --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run tests | |
run: just test --profile ci | |
env: | |
AOC_INPUTS_SECRET: ${{ secrets.AOC_INPUTS_SECRET }} | |
test-bench: | |
name: Test Benchmarks | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
run: rustup install stable | |
- name: Set stable toolchain as default | |
run: rustup default stable | |
- name: Populate Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- name: Install `cargo-binstall` | |
uses: cargo-bins/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install `cargo-nextest`, `rage`, `just` | |
run: cargo binstall cargo-nextest rage just --secure --no-confirm --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run tests | |
run: just test --profile ci --bench bench | |
env: | |
AOC_INPUTS_SECRET: ${{ secrets.AOC_INPUTS_SECRET }} | |
bench: | |
name: Run Benchmarks | |
needs: test-bench | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
run: rustup install stable | |
- name: Set stable toolchain as default | |
run: rustup default stable | |
- name: Populate Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- name: Install `cargo-binstall` | |
uses: cargo-bins/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install `rage`, `just` | |
run: cargo binstall rage just --secure --no-confirm --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install `bencher` | |
uses: bencherdev/bencher@main | |
- name: Run benchmarks | |
run: just bencher ${{ matrix.os }} | |
env: | |
AOC_INPUTS_SECRET: ${{ secrets.AOC_INPUTS_SECRET }} | |
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} |