Mid-fall Nix and CI cleaning #3
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: | |
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: stable | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --locked --release | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
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 run \ | |
--inputs-from . \ | |
nixpkgs#nix-fast-build -- \ | |
--no-nom \ | |
--skip-cached | |
# 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 |