-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (55 loc) · 1.93 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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@main
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- 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@v2
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 `nix fmt`
run: nix fmt -- --check .
- 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@main
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- 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@v2
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