name: ci
on:
pull_request:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa - uses: DeterminateSystems/flakehub-cache-action@83282a8aef353db1d659d3bacf4a28b6683de0b3 - name: Show nix version
run: nix --version
- name: Set up nix dev env
run: nix develop --command echo 0
- name: Set nix rustc env var
run: echo "NIX_RUSTC_VERSION=$(nix develop --ignore-environment --command rustc --version --verbose | tr -d '\n')" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 with:
key: ${{ env.NIX_RUSTC_VERSION }}
- name: Run `cargo check`
run: nix develop --ignore-environment --command cargo check
- name: Run `cargo clippy`
run: nix develop --command cargo clippy --workspace --all-targets -- -D warnings
- name: Run `cargo test`
run: nix develop --command cargo test --workspace
- name: Run `cargo fmt`
run: nix develop --command cargo fmt --check
- name: Run `cargo rustdoc`
run: nix develop --command cargo rustdoc --all-features -- -Zunstable-options --check -Dwarnings
- name: Run `nix fmt`
run: nix fmt -- --check .
- name: Ensure C code is formatted
run: nix develop --command just c-fmt && git diff --exit-code
- name: Run `cargo shear`
run: nix develop --command cargo shear
ci-arm:
runs-on: ubuntu-22.04-arm
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa - uses: DeterminateSystems/flakehub-cache-action@83282a8aef353db1d659d3bacf4a28b6683de0b3 - name: Set up nix dev env
run: nix develop --command echo 0
- name: Set nix rustc env var
run: echo "NIX_RUSTC_VERSION=$(nix develop --ignore-environment --command rustc --version --verbose | tr -d '\n')" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 with:
key: ${{ env.NIX_RUSTC_VERSION }}
- name: Run `cargo check`
run: nix develop --ignore-environment --command cargo check
- name: Run `cargo test`
run: nix develop --command cargo test --workspace