Skip to content

Commit 7bd70f1

Browse files
committed
Add full flake check in CI and monthly flake.lock maintence job
Add flake check in CI workflow and weekly flake.lock update and check after lock updates
1 parent e8d89b6 commit 7bd70f1

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.github/workflows/flake-check.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Flake Check
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
paths-ignore:
8+
- "flake.lock"
9+
10+
jobs:
11+
flake-check:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
checks:
16+
- msrv
17+
- stable
18+
- nightly
19+
- maintenance
20+
- no-build
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install Nix
26+
uses: DeterminateSystems/nix-installer-action@main
27+
28+
- name: Enable magic Nix cache
29+
uses: DeterminateSystems/magic-nix-cache-action@main
30+
31+
- name: Run full flake check
32+
run: |
33+
if [ "${{ matrix.checks }}" = "no-build" ]; then
34+
nix flake check --no-build
35+
else
36+
nix build .#checks.x86_64-linux.${{ matrix.checks }}
37+
fi
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Flake maintenance
2+
3+
on:
4+
schedule:
5+
- cron: "0 14 * * 1" # weekly at 14:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-flake-lock:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install Nix
19+
uses: DeterminateSystems/nix-installer-action@main
20+
21+
- name: Enable magic Nix cache
22+
uses: DeterminateSystems/magic-nix-cache-action@main
23+
24+
- name: Validate recreated lockfile
25+
run: nix flake check -L --recreate-lock-file --no-write-lock-file
26+
27+
- name: Update flake.lock
28+
uses: DeterminateSystems/update-flake-lock@main
29+
with:
30+
pr-title: "chore: update flake.lock"
31+
commit-msg: "chore: update flake.lock"
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
nix-options: --offline

flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,16 @@
309309
]
310310
++ pkgs.lib.attrValues packages
311311
);
312+
313+
maintenance = checkSuite "maintenance" (
314+
with self.outputs.checks.${system};
315+
[
316+
payjoin-workspace-machete
317+
payjoin-workspace-clippy
318+
payjoin-workspace-doc
319+
formatting
320+
]
321+
);
312322
};
313323
}
314324
);

0 commit comments

Comments
 (0)