-
-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (62 loc) · 1.83 KB
/
Copy pathbuild-dev-shells.yml
File metadata and controls
62 lines (62 loc) · 1.83 KB
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
56
57
58
59
60
61
62
name: Build and Cache Dev Shells
permissions:
contents: read
on:
push:
branches: [main]
paths:
- "shells/**"
- "flake.nix"
- "flake.lock"
pull_request:
paths:
- "shells/**"
- "flake.nix"
- "flake.lock"
workflow_dispatch:
schedule:
# Run weekly to keep cache fresh
- cron: "0 2 * * 0"
jobs:
build-dev-shells:
name: Build dev shells on ${{ matrix.system }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- system: x86_64-linux
os: ubuntu-latest
- system: aarch64-darwin
os: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
auto-optimise-store = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
system = ${{ matrix.system }}
- name: Setup Cachix
uses: cachix/cachix-action@v16
with:
name: khanelinix
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Get dev shell list
id: shells
run: |
shells=$(nix flake show --json | jq -r '.devShells."${{ matrix.system }}" | keys[]' | tr '\n' ' ')
echo "shells=$shells" >> "$GITHUB_OUTPUT"
- name: Build and cache dev shells
run: |
for shell in ${{ steps.shells.outputs.shells }}; do
echo "Building dev shell: $shell"
nix develop .#$shell --command echo "Dev shell $shell built successfully"
done
- name: Build default dev shell
run: |-
echo "Building default dev shell"
nix develop --command echo "Default dev shell built successfully"