Skip to content

Commit b9dc09c

Browse files
committed
flake.nix: build all packages though a single evaluation
1 parent 6dd6f2c commit b9dc09c

18 files changed

+171
-8
lines changed

.github/workflows/bm_maintenance.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19+
nix-build:
20+
uses: ./.github/workflows/nix_build.yml
21+
secrets:
22+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
23+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
24+
1925
build-image:
2026
name: "Build cleanup-bare-metal image"
2127
runs-on: ubuntu-24.04
28+
needs: nix-build
2229
permissions:
2330
contents: read
2431
packages: write

.github/workflows/check_patches.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ on:
99
- packages/by-name/kata/kata-runtime/0*.patch
1010

1111
jobs:
12+
nix-build:
13+
uses: ./.github/workflows/nix_build.yml
14+
secrets:
15+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
16+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
17+
1218
check-patches:
1319
runs-on: ubuntu-24.04
20+
needs: nix-build
1421
timeout-minutes: 15
1522
permissions:
1623
contents: read

.github/workflows/docs_publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@ permissions:
2727
pull-requests: write
2828

2929
jobs:
30+
nix-build:
31+
uses: ./.github/workflows/nix_build.yml
32+
secrets:
33+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
34+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
35+
3036
deploy:
3137
name: Publish docs to GitHub Pages
3238
runs-on: ubuntu-24.04
39+
needs: nix-build
3340
# Prevent the job from running on forked PRs, for security reasons.
3441
if: |
3542
(github.event_name == 'push' && github.ref_name == 'main') ||

.github/workflows/e2e.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ env:
3838
DO_NOT_TRACK: 1
3939

4040
jobs:
41+
nix-build:
42+
uses: ./.github/workflows/nix_build.yml
43+
secrets:
44+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
45+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
46+
4147
test:
4248
name: "${{ inputs.test-name }}${{ inputs.debug-shell && ' (with debug shell)' || '' }}"
4349
runs-on: ${{ inputs.runner }}
50+
needs: nix-build
4451
permissions:
4552
contents: read
4653
packages: write

.github/workflows/imagepuller-benchmark.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ on:
1212
- main
1313

1414
jobs:
15+
nix-build:
16+
uses: ./.github/workflows/nix_build.yml
17+
secrets:
18+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
19+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
20+
1521
run-benchmark:
1622
runs-on: ubuntu-24.04
23+
needs: nix-build
1724
permissions:
1825
contents: read
1926
packages: read

.github/workflows/k3s_compatibility.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ env:
1212
container_registry: ghcr.io/edgelesssys
1313

1414
jobs:
15+
nix-build:
16+
uses: ./.github/workflows/nix_build.yml
17+
secrets:
18+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
19+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
20+
1521
test:
1622
runs-on: ubuntu-24.04
23+
needs: nix-build
1724
permissions:
1825
contents: read
1926
packages: write

.github/workflows/links.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ on:
99
- ".github/workflows/links.yml"
1010

1111
jobs:
12+
nix-build:
13+
uses: ./.github/workflows/nix_build.yml
14+
secrets:
15+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
16+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
17+
1218
check-links:
1319
name: check external links
1420
runs-on: ubuntu-24.04
21+
needs: nix-build
1522
timeout-minutes: 15
1623
permissions:
1724
contents: read

.github/workflows/nix_build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: build and cache all flake outputs
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
GITHUB_TOKEN_IN:
7+
required: true
8+
CACHIX_AUTH_TOKEN:
9+
required: true
10+
11+
jobs:
12+
nix-build:
13+
runs-on: ${{ matrix.runner }}
14+
permissions:
15+
contents: read
16+
strategy:
17+
matrix:
18+
include:
19+
- runner: yet-to-be-set-up-nix-build-host
20+
system: x86_64-linux
21+
steps:
22+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23+
with:
24+
persist-credentials: false
25+
- uses: ./.github/actions/setup_nix
26+
with:
27+
githubToken: ${{ secrets.GITHUB_TOKEN_IN || secrets.GITHUB_TOKEN }}
28+
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
29+
- name: pre-build all flake outputs
30+
run: |
31+
nix build .#matrix.${{ matrix.system }}

.github/workflows/pr_release_artifacts.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ on:
1212
default: false
1313

1414
jobs:
15+
nix-build:
16+
uses: ./.github/workflows/nix_build.yml
17+
secrets:
18+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
19+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
20+
1521
create-release-artifacts:
1622
name: Create release artifacts for PR
1723
if: github.event_name == 'workflow_dispatch' && github.event.inputs.cleanup == 'false'
1824
runs-on: ubuntu-24.04
25+
needs: nix-build
1926
permissions:
2027
pull-requests: write
2128
issues: write

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,16 @@ jobs:
119119
exit 1
120120
fi
121121
122+
nix-build:
123+
uses: ./.github/workflows/nix_build.yml
124+
secrets:
125+
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN_IN }}
126+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
127+
122128
update-main:
123129
name: Update main branch
124130
runs-on: ubuntu-24.04
125-
needs: [process-inputs, release]
131+
needs: [process-inputs, release, nix-build]
126132
permissions:
127133
contents: write
128134
env:
@@ -220,7 +226,7 @@ jobs:
220226
release:
221227
name: Build and push artifacts, create release
222228
runs-on: ubuntu-24.04
223-
needs: process-inputs
229+
needs: [process-inputs, nix-build]
224230
permissions:
225231
contents: write
226232
packages: write
@@ -311,7 +317,7 @@ jobs:
311317
# Job needs content:write to see draft releases.
312318
contents: write
313319
packages: read
314-
needs: [process-inputs, release]
320+
needs: [process-inputs, release, nix-build]
315321
env:
316322
VERSION: ${{ inputs.version }}
317323
steps:

0 commit comments

Comments
 (0)