Mid-fall Nix and CI cleaning #7
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: | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Build | |
run: cargo build --locked --release | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Check formatting | |
uses: actions-rust-lang/rustfmt@v1 | |
nix: | |
name: Nix | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v13 | |
- name: Setup Nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@v7 | |
- name: Run treefmt | |
run: | | |
nix build --print-build-logs .#check-treefmt | |
- name: Build package | |
run: | | |
nix build --print-build-logs .#refraction | |
# Make sure all above jobs finished successfully | |
release-gate: | |
name: CI Release gate | |
needs: [build, rustfmt, nix] | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Exit with error | |
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: exit 1 |