-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.24 KB
/
nix-lints.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
name: Nix Lints
on:
push:
paths:
# Run if workflow changes
- '.github/workflows/nix-lints.yml'
# Run on changed flake
- 'flake.nix'
- 'flake.lock'
branches:
- main
pull_request:
branches: main
# Run manually
workflow_dispatch:
jobs:
nix_fmt:
name: Nix format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v22
- name: Cache /nix/store
uses: actions/cache@v3
with:
path: /nix/store
key: ${{ runner.os }}-${{ hashFiles('flake.*') }}-${{ hashFiles('.github/workflows/web-api-ci.yml') }}
- name: Check nix formatting
run: nix fmt --accept-flake-config -- --check .
nix_dead_code:
name: Nix dead code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v22
- name: Cache /nix/store
uses: actions/cache@v3
with:
path: /nix/store
key: ${{ runner.os }}-${{ hashFiles('flake.*') }}-${{ hashFiles('.github/workflows/web-api-ci.yml') }}
- name: Check for dead nix code
run: nix run github:astro/deadnix -- .