Skip to content

Commit 45eea90

Browse files
jfrocheyvan-sraka
authored andcommitted
refactor(ci): extract nix eval into reusable workflow
1 parent acc6e77 commit 45eea90

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

.github/workflows/nix-build.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,10 @@ permissions:
1616

1717
jobs:
1818
nix-eval:
19-
runs-on: blacksmith-32vcpu-ubuntu-2404
20-
outputs:
21-
matrix: ${{ steps.set-matrix.outputs.matrix }}
22-
steps:
23-
- name: Checkout Repo
24-
uses: actions/checkout@v4
25-
- name: Install nix
26-
uses: ./.github/actions/nix-install-ephemeral
27-
- id: set-matrix
28-
name: Generate Nix Matrix
29-
run: |
30-
set -Eeu
31-
echo matrix="$(nix shell github:nix-community/nix-eval-jobs --command scripts/github-matrix.py checks legacyPackages)" >> "$GITHUB_OUTPUT"
19+
uses: ./.github/workflows/nix-eval.yml
20+
secrets:
21+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
22+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
3223

3324
nix-build-aarch64-linux:
3425
name: ${{ matrix.name }} (aarch64-linux)

.github/workflows/nix-eval.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Nix Eval
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix:
7+
description: 'Generated build matrix'
8+
value: ${{ jobs.eval.outputs.matrix }}
9+
secrets:
10+
DEV_AWS_ROLE:
11+
required: false
12+
NIX_SIGN_SECRET_KEY:
13+
required: false
14+
15+
jobs:
16+
eval:
17+
runs-on: blacksmith-32vcpu-ubuntu-2404
18+
outputs:
19+
matrix: ${{ steps.set-matrix.outputs.matrix }}
20+
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v4
23+
- name: Install nix
24+
uses: ./.github/actions/nix-install-ephemeral
25+
env:
26+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
27+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
28+
- id: set-matrix
29+
name: Generate Nix Matrix
30+
run: |
31+
set -Eeu
32+
echo matrix="$(nix shell github:nix-community/nix-eval-jobs/v2.31.0 --command scripts/github-matrix.py checks legacyPackages)" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)