Skip to content

Commit 02f517c

Browse files
committed
CI/check: init
Checks the whole repo using the Nix lint package.
1 parent 182bb3a commit 02f517c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/check.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check formatting
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
jobs:
5+
check:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
10+
- name: Install Nix
11+
uses: nixbuild/nix-quick-install-action@v31
12+
with:
13+
nix_conf: |
14+
keep-env-derivations = true
15+
keep-outputs = true
16+
17+
- name: Restore and save Nix store
18+
uses: nix-community/cache-nix-action@v6
19+
with:
20+
# restore and save a cache using this key
21+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
22+
# if there's no cache hit, restore a cache by this prefix
23+
restore-prefixes-first-match: nix-${{ runner.os }}-
24+
# collect garbage until the Nix store size (in bytes) is at most this number
25+
# before trying to save a new cache
26+
# 1G = 1073741824
27+
gc-max-store-size-linux: 1G
28+
# do purge caches
29+
purge: true
30+
# purge all versions of the cache
31+
purge-prefixes: nix-${{ runner.os }}-
32+
# created more than this number of seconds ago
33+
purge-created: 0
34+
# or, last accessed more than this number of seconds ago
35+
# relative to the start of the `Post Restore and save Nix store` phase
36+
purge-last-accessed: 0
37+
# except any version with the key that is the same as the `primary-key`
38+
purge-primary-key: never
39+
40+
- run: |
41+
cd lint
42+
nix run .. -- checkall

0 commit comments

Comments
 (0)