Skip to content

Don't bench on windows for now #91

Don't bench on windows for now

Don't bench on windows for now #91

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
NEXTEST_PROFILE: ci
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-integration:
needs: lint
name: Test (Integration)
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 integration tests
run: just test --test=integration
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 --bench=bench
env:
AOC_INPUTS_SECRET: ${{ secrets.AOC_INPUTS_SECRET }}
bench:
name: Bench
needs:
- test-bench
- test-integration
env:
CRITERION_OUTPUT_FILE: benchmarks.json
strategy:
matrix:
# windows-latest is broken, see https://github.com/bheisler/criterion.rs/issues/517
os: [ubuntu-latest, macos-latest]
year: [2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024]
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`, `cargo-criterion`
run: cargo binstall cargo-nextest rage just cargo-criterion --secure --no-confirm --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run benchmarks
run: just bench --message-format=json --color=always > ${{ env.CRITERION_OUTPUT_FILE }} -- ${{ matrix.year }}
env:
AOC_INPUTS_SECRET: ${{ secrets.AOC_INPUTS_SECRET }}
- name: Upload benchmarks
uses: actions/[email protected]
with:
name: benchmark-results-${{ github.sha }}-${{ matrix.os }}-${{ matrix.year }}
path: ${{ env.CRITERION_OUTPUT_FILE }}
if-no-files-found: error