Skip to content

Commit c456f10

Browse files
committed
Add CI workflow at .github/workflows/nix.ci.yml
This CI integration rejects push/pull-requests which are either A. Not formatted correctly. B. Fail the nix check (i.e. are broken).
1 parent 74735d3 commit c456f10

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/nix-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Nix CI
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.nix'
7+
pull_request:
8+
paths:
9+
- '**/*.nix'
10+
workflow_dispatch:
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Nix
21+
uses: cachix/install-nix-action@v22
22+
with:
23+
nix_path: nixpkgs=channel:nixos-unstable
24+
25+
- name: Check nix flake
26+
run: nix flake check
27+
28+
format:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Nix
36+
uses: cachix/install-nix-action@v22
37+
with:
38+
nix_path: nixpkgs=channel:nixos-unstable
39+
40+
- name: Install nixfmt
41+
run: nix-shell -p nixfmt-rfc-style --command "find . -name '*.nix' -print0 | xargs -0 nixfmt --check"

0 commit comments

Comments
 (0)