Skip to content

Commit 78f636d

Browse files
committed
CI: Fix Nix workflows
- General Flake updates - Move CI Nix setup to reusable action - Replace deprecated `DeterminateSystems/magic-nix-cache-action@main`[1] with `nix-community/cache-nix-action@v6` [1] https://determinate.systems/posts/magic-nix-cache-free-tier-eol/
1 parent 2bed1c5 commit 78f636d

File tree

4 files changed

+32
-25
lines changed

4 files changed

+32
-25
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Setup Nix"
2+
description: "Install and configure Nix for Github Actions"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: nixbuild/nix-quick-install-action@v30
7+
- uses: nix-community/cache-nix-action@v6
8+
with:
9+
# restore and save a cache using this key
10+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock', "uv.lock") }}
11+
# if there's no cache hit, restore a cache by this prefix
12+
restore-prefixes-first-match: nix-${{ runner.os }}-

.github/workflows/cd-docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: DeterminateSystems/nix-installer-action@main
25-
- uses: DeterminateSystems/magic-nix-cache-action@main
24+
- uses: ./.github/actions/setup-nix
2625

2726
- run: nix build '.#docs'
2827

.github/workflows/ci-nix-template.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: DeterminateSystems/nix-installer-action@main
22-
- uses: DeterminateSystems/magic-nix-cache-action@main
21+
- uses: ./.github/actions/setup-nix
2322

2423
- name: Run build
2524
run: nix build
@@ -31,8 +30,7 @@ jobs:
3130

3231
steps:
3332
- uses: actions/checkout@v4
34-
- uses: DeterminateSystems/nix-installer-action@main
35-
- uses: DeterminateSystems/magic-nix-cache-action@main
33+
- uses: ./.github/actions/setup-nix
3634
- uses: DeterminateSystems/flake-checker-action@main
3735

3836
- name: Run lint
@@ -46,8 +44,7 @@ jobs:
4644
steps:
4745
- uses: actions/checkout@v4
4846
- uses: ./.github/actions/configure-git
49-
- uses: DeterminateSystems/nix-installer-action@main
50-
- uses: DeterminateSystems/magic-nix-cache-action@main
47+
- uses: ./.github/actions/setup-nix
5148

5249
- name: Run tests
5350
run: nix develop --command bash -c "make test"
@@ -60,8 +57,7 @@ jobs:
6057
steps:
6158
- uses: actions/checkout@v4
6259
- uses: ./.github/actions/configure-git
63-
- uses: DeterminateSystems/nix-installer-action@main
64-
- uses: DeterminateSystems/magic-nix-cache-action@main
60+
- uses: ./.github/actions/setup-nix
6561

6662
- name: Run install
6763
run: nix profile install '.'

flake.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)