Skip to content

Commit 6d656db

Browse files
workflows/build: build all the basics in a single workflow
This new workflow builds both manuals, the shell and the lib tests all in a matrix of four jobs. This allows re-using the shared checkout and the pinned nixpkgs download and saves time in the most likely cache: No changes, just download from cache. Each step checks the cancelled condition, which causes it to run even if the previous steps failed. This way we get a full picture even if the first step fails immediately. This could later be optimized to build more in parallel as well, but we'll first need to clear the conditions on building the manuals on the master branch only. This reduces the number of jobs from up to 8 to 4 for this part. (cherry picked from commit cd82aa5)
1 parent 6e745dc commit 6d656db

File tree

4 files changed

+36
-152
lines changed

4 files changed

+36
-152
lines changed
Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
name: "Build NixOS manual v2"
1+
name: Build
22

33
on:
44
pull_request:
55
paths:
6-
- .github/workflows/manual-nixos-v2.yml
6+
- .github/workflows/build.yml
77
pull_request_target:
8-
branches:
9-
- master
10-
- release-*
118

129
concurrency:
1310
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
@@ -20,16 +17,24 @@ defaults:
2017
shell: bash
2118

2219
jobs:
23-
nixos:
24-
name: nixos-manual-build
20+
build:
2521
strategy:
2622
fail-fast: false
2723
matrix:
2824
include:
2925
- runner: ubuntu-24.04
3026
system: x86_64-linux
27+
builds: [shell,manual-nixos,lib-tests]
3128
- runner: ubuntu-24.04-arm
3229
system: aarch64-linux
30+
builds: [shell,manual-nixos,manual-nixpkgs,manual-nixpkgs-tests]
31+
- runner: macos-13
32+
system: x86_64-darwin
33+
builds: [shell]
34+
- runner: macos-14
35+
system: aarch64-darwin
36+
builds: [shell]
37+
name: ${{ matrix.system }}
3338
runs-on: ${{ matrix.runner }}
3439
steps:
3540
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -50,13 +55,34 @@ jobs:
5055
name: nixpkgs-ci
5156
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
5257

58+
- name: Build shell
59+
if: contains(matrix.builds, 'shell')
60+
run: nix-build untrusted/ci -A shell
61+
5362
- name: Build NixOS manual
54-
id: build-manual
55-
run: nix-build untrusted/ci -A manual-nixos --argstr system ${{ matrix.system }}
63+
if: |
64+
contains(matrix.builds, 'manual-nixos') && !cancelled() &&
65+
(github.base_ref == 'master' || startsWith(github.base_ref, 'release-'))
66+
run: nix-build untrusted/ci -A manual-nixos --argstr system ${{ matrix.system }} --out-link nixos-manual
67+
68+
- name: Build Nixpkgs manual
69+
if: contains(matrix.builds, 'manual-nixpkgs') && !cancelled()
70+
run: nix-build untrusted/ci -A manual-nixpkgs -A manual-nixpkgs-tests
71+
72+
- name: Build Nixpkgs manual tests
73+
if: contains(matrix.builds, 'manual-nixpkgs-tests') && !cancelled()
74+
run: nix-build untrusted/ci -A manual-nixpkgs-tests
75+
76+
- name: Build lib tests
77+
if: contains(matrix.builds, 'lib-tests') && !cancelled()
78+
run: nix-build untrusted/ci -A lib-tests
5679

5780
- name: Upload NixOS manual
81+
if: |
82+
contains(matrix.builds, 'manual-nixos') && !cancelled() &&
83+
(github.base_ref == 'master' || startsWith(github.base_ref, 'release-'))
5884
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5985
with:
6086
name: nixos-manual-${{ matrix.system }}
61-
path: result/
87+
path: nixos-manual
6288
if-no-files-found: error

.github/workflows/check-shell.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/lib-tests.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/manual-nixpkgs-v2.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)