ci: add nix env and gha workflows #2
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: Rust CI | |
on: | |
pull_request: | |
jobs: | |
check: | |
name: cargo check | |
runs-on: buildjet-8vcpu-ubuntu-2204 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: install nix | |
uses: nixbuild/nix-quick-install-action@v28 | |
- name: setup nix cache | |
uses: nix-community/cache-nix-action@v5 | |
with: | |
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} | |
restore-prefixes-first-match: nix-${{ runner.os }}- | |
backend: buildjet | |
- name: Load rust cache | |
uses: astriaorg/buildjet-rust-cache@v2.5.1 | |
- name: Run cargo check, failing on warnings | |
run: >- | |
nix develop --command | |
just check | |
fmt: | |
name: cargo fmt | |
runs-on: buildjet-8vcpu-ubuntu-2204 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install nix | |
uses: nixbuild/nix-quick-install-action@v28 | |
- name: setup nix cache | |
uses: nix-community/cache-nix-action@v5 | |
with: | |
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} | |
restore-prefixes-first-match: nix-${{ runner.os }}- | |
backend: buildjet | |
- name: Load rust cache | |
uses: astriaorg/buildjet-rust-cache@v2.5.1 | |
- name: Run cargo fmt, failing on reformatting | |
run: >- | |
nix develop --command | |
just fmt |