Skip to content

Commit c8efd97

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 61b6b27 commit c8efd97

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/flake-check.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Continuous integration
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+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install Nix
18+
uses: DeterminateSystems/nix-installer-action@main
19+
20+
- name: Enable magic Nix cache
21+
uses: DeterminateSystems/magic-nix-cache-action@main
22+
23+
- name: Run full flake check
24+
run: nix flake check -L
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

0 commit comments

Comments
 (0)