Mid-fall Nix and CI cleaning #1
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
# TODO: use latest compiler. `time` fails to compile on 1.80.0 currently | |
env: | |
RUST_TOOLCHAIN: 1.79.0 | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --locked --target | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
# TODO: use latest compiler. `time` fails to compile on 1.80.0 currently | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt -- --check | |
nix: | |
name: Check Nix Flake | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v13 | |
- name: Run checks | |
run: | | |
nix flake check \ | |
--all-systems \ | |
--print-build-logs \ | |
--show-trace | |
# Make sure all above jobs finished successfully | |
release-gate: | |
name: CI Release gate | |
needs: [build, format, nix] | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Exit with error | |
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: exit 1 |