-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 2.07 KB
/
Copy pathci.yml
File metadata and controls
85 lines (72 loc) · 2.07 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
permissions: { contents: read }
on:
push: { branches: [main] }
pull_request: { branches: [main] }
workflow_dispatch: {}
jobs:
test:
strategy: &os-matrix
fail-fast: false
matrix: { os: [ubuntu-24.04-arm, ubuntu-24.04, macos-26] }
runs-on: ${{ matrix.os }}
steps:
- &checkout
uses: actions/checkout@v7
with: { persist-credentials: false }
- &nix-install
name: Install Nix
uses: nixbuild/nix-quick-install-action@v35
- &nix-cache
name: Cache Nix store
uses: nix-community/cache-nix-action@v7
with:
primary-key: >-
nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
# Purge matching prefixes last accessed more than 7 days ago
purge: true
purge-prefixes: nix-${{ runner.os }}-${{ runner.arch }}-
purge-last-accessed: P7D
# Load the flake's devShell environment so rust-cache finds the correct rustc version
- &nix-develop
name: Load flake devShell
uses: nicknovitski/nix-develop@v1
- &rust-cache
name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run tests
run: just test
lint:
strategy: *os-matrix
runs-on: ${{ matrix.os }}
steps:
- *checkout
- *nix-install
- *nix-cache
- *nix-develop
- *rust-cache
- name: Run lints
run: just lint
fmt-check:
runs-on: ubuntu-24.04-arm
steps:
- *checkout
- *nix-install
- *nix-cache
- name: Check formatting
run: nix develop --command just fmt-check
spell-check:
runs-on: ubuntu-24.04-arm
steps:
- *checkout
- *nix-install
- *nix-cache
- name: Check spelling
run: nix develop --command just spell-check
all-checks:
runs-on: ubuntu-slim
permissions: {}
needs: [test, lint, fmt-check, spell-check]
steps:
- run: echo 'All checks passed!'