From c3b29c1c8cce4fb70876d6afaeccc626a7bef7be Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 10:56:16 -0400 Subject: [PATCH 01/10] Pass the system to build.yml directly --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f04126747..a30eb3ed4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,11 @@ on: os: required: true type: string + system: + required: true + type: string jobs: - build: strategy: fail-fast: false @@ -16,13 +18,11 @@ jobs: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main with: - flakehub: true + determinate: true - uses: DeterminateSystems/flakehub-cache-action@main - - run: echo "system=$(nix eval --impure --raw --expr 'builtins.currentSystem')" >> "$GITHUB_OUTPUT" - id: system - - run: nix build .# .#binaryTarball --no-link -L - - run: nix build .#binaryTarball --out-link tarball + - run: nix build .#packages.${{ inputs.system }}.default .#packages.${{ inputs.system }}.binaryTarball --no-link -L + - run: nix build .#packages.${{ inputs.system }}.binaryTarball --out-link tarball - uses: actions/upload-artifact@v4 with: - name: ${{ steps.system.outputs.system }} + name: ${{ inputs.system }} path: ./tarball/*.xz From 5766d207a54a04f02788ccf553d7a3fcd0a21a1f Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 10:58:38 -0400 Subject: [PATCH 02/10] Pass system from ci --- .github/workflows/ci.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1fefc8df..28259974f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,35 +17,39 @@ jobs: eval: runs-on: blacksmith-32vcpu-ubuntu-2204 steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: DeterminateSystems/nix-installer-action@main - with: - flakehub: true - - run: nix flake show --all-systems --json + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: DeterminateSystems/nix-installer-action@main + with: + flakehub: true + - run: nix flake show --all-systems --json build_x86_64-linux: uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204 + system: x86_64-linux build_aarch64-linux: if: github.event_name == 'merge_group' uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204-arm + system: aarch64-linux build_x86_64-darwin: if: github.event_name == 'merge_group' uses: ./.github/workflows/build.yml with: os: macos-latest-large + system: x86_64-darwin build_aarch64-darwin: uses: ./.github/workflows/build.yml with: os: macos-latest-xlarge + system: aarch64-darwin test_x86_64-linux: uses: ./.github/workflows/test.yml From 10b7535c87c5fa2ebd25c8b69d8a076cdda0f26d Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:00:31 -0400 Subject: [PATCH 03/10] Pass system to test.yml --- .github/workflows/test.yml | 7 ++++--- .github/workflows/upload-release.yml | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e58827a9c..a54b1f839 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,10 @@ on: os: required: true type: string - + system: + required: true + type: string jobs: - tests: strategy: fail-fast: false @@ -18,4 +19,4 @@ jobs: with: flakehub: true - uses: DeterminateSystems/flakehub-cache-action@main - - run: nix flake check -L + - run: nix flake check -L --system ${{ inputs.system }} diff --git a/.github/workflows/upload-release.yml b/.github/workflows/upload-release.yml index b600dfba0..f762446bd 100644 --- a/.github/workflows/upload-release.yml +++ b/.github/workflows/upload-release.yml @@ -29,18 +29,25 @@ jobs: uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204 + system: x86_64-linux + build-aarch64-linux: uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204-arm + system: aarch64-linux + build-x86_64-darwin: uses: ./.github/workflows/build.yml with: os: macos-13 + system: x86_64-darwin + build-aarch64-darwin: uses: ./.github/workflows/build.yml with: os: macos-latest + system: aarch64-darwin release: runs-on: ubuntu-latest From 6469efee7be029d82806e41a9300d6f4648d5490 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:04:51 -0400 Subject: [PATCH 04/10] Pass the system to the test yml from ci --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28259974f..fc7f491d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,7 @@ jobs: needs: build_x86_64-linux with: os: blacksmith-32vcpu-ubuntu-2204 + system: x86_64-linux test_aarch64-linux: if: github.event_name == 'merge_group' @@ -63,13 +64,15 @@ jobs: needs: build_aarch64-linux with: os: blacksmith-32vcpu-ubuntu-2204-arm + system: aarch64-linux test_x86_64-darwin: if: github.event_name == 'merge_group' uses: ./.github/workflows/test.yml - needs: build_aarch64-darwin + needs: build_x86_64-darwin with: os: macos-latest-large + system: x86_64-darwin test_aarch64-darwin: if: github.event_name == 'merge_group' @@ -77,6 +80,7 @@ jobs: needs: build_aarch64-darwin with: os: macos-latest-xlarge + system: aarch64-darwin vm_tests_smoke: if: github.event_name != 'merge_group' From 8762c10aaebc0344b56ab78756e1f3ed8df77b44 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:06:22 -0400 Subject: [PATCH 05/10] Move the if evaluation of the test jobs onthe tests job itself, so we can skip it properly in PRs and block on it in merge groups --- .github/workflows/ci.yml | 6 +++--- .github/workflows/test.yml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc7f491d8..7c1ef3cda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,26 +59,26 @@ jobs: system: x86_64-linux test_aarch64-linux: - if: github.event_name == 'merge_group' uses: ./.github/workflows/test.yml needs: build_aarch64-linux with: + if: github.event_name == 'merge_group' os: blacksmith-32vcpu-ubuntu-2204-arm system: aarch64-linux test_x86_64-darwin: - if: github.event_name == 'merge_group' uses: ./.github/workflows/test.yml needs: build_x86_64-darwin with: + if: github.event_name == 'merge_group' os: macos-latest-large system: x86_64-darwin test_aarch64-darwin: - if: github.event_name == 'merge_group' uses: ./.github/workflows/test.yml needs: build_aarch64-darwin with: + if: github.event_name == 'merge_group' os: macos-latest-xlarge system: aarch64-darwin diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a54b1f839..49af88020 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,8 +7,13 @@ on: system: required: true type: string + if: + required: false + default: true + type: boolean jobs: tests: + if: ${{ inputs.if }} strategy: fail-fast: false runs-on: ${{ inputs.os }} From 96e7e63ea08d2b4d30382012429a9e99b7acaf7d Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:09:04 -0400 Subject: [PATCH 06/10] Bigger runners thank you --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c1ef3cda..b363f9951 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,13 +42,13 @@ jobs: if: github.event_name == 'merge_group' uses: ./.github/workflows/build.yml with: - os: macos-latest-large + os: namespace-profile-mac-m2-12c28g system: x86_64-darwin build_aarch64-darwin: uses: ./.github/workflows/build.yml with: - os: macos-latest-xlarge + os: namespace-profile-mac-m2-12c28g system: aarch64-darwin test_x86_64-linux: @@ -71,7 +71,7 @@ jobs: needs: build_x86_64-darwin with: if: github.event_name == 'merge_group' - os: macos-latest-large + os: namespace-profile-mac-m2-12c28g system: x86_64-darwin test_aarch64-darwin: @@ -79,7 +79,7 @@ jobs: needs: build_aarch64-darwin with: if: github.event_name == 'merge_group' - os: macos-latest-xlarge + os: namespace-profile-mac-m2-12c28g system: aarch64-darwin vm_tests_smoke: From feba05b18dec460bdae4857edc2a6f2dacff9c3b Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:15:04 -0400 Subject: [PATCH 07/10] fixup ifs --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b363f9951..b2b542bcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: uses: ./.github/workflows/test.yml needs: build_aarch64-linux with: - if: github.event_name == 'merge_group' + if: ${{ github.event_name == 'merge_group' }} os: blacksmith-32vcpu-ubuntu-2204-arm system: aarch64-linux @@ -70,7 +70,7 @@ jobs: uses: ./.github/workflows/test.yml needs: build_x86_64-darwin with: - if: github.event_name == 'merge_group' + if: ${{ github.event_name == 'merge_group' }} os: namespace-profile-mac-m2-12c28g system: x86_64-darwin @@ -78,7 +78,7 @@ jobs: uses: ./.github/workflows/test.yml needs: build_aarch64-darwin with: - if: github.event_name == 'merge_group' + if: ${{ github.event_name == 'merge_group' }} os: namespace-profile-mac-m2-12c28g system: aarch64-darwin From 2315b54f914796dc54a8cc54084573da1a259f6b Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 11:22:58 -0400 Subject: [PATCH 08/10] Move down the if from build workflows --- .github/workflows/build.yml | 5 +++++ .github/workflows/ci.yml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a30eb3ed4..84dbdfd79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,14 @@ on: system: required: true type: string + if: + required: false + default: true + type: boolean jobs: build: + if: ${{ inputs.if }} strategy: fail-fast: false runs-on: ${{ inputs.os }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2b542bcc..6bba30f9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,16 +32,16 @@ jobs: system: x86_64-linux build_aarch64-linux: - if: github.event_name == 'merge_group' uses: ./.github/workflows/build.yml with: + if: ${{ github.event_name == 'merge_group' }} os: blacksmith-32vcpu-ubuntu-2204-arm system: aarch64-linux build_x86_64-darwin: - if: github.event_name == 'merge_group' uses: ./.github/workflows/build.yml with: + if: ${{ github.event_name == 'merge_group' }} os: namespace-profile-mac-m2-12c28g system: x86_64-darwin From 42cb18970337d4b417b38fb8762a82c61eefcd52 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 12:20:28 -0400 Subject: [PATCH 09/10] success/failure the vm checks --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bba30f9d..bff8dcc4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,7 @@ jobs: system: x86_64-linux test_aarch64-linux: + if: success() || failure() uses: ./.github/workflows/test.yml needs: build_aarch64-linux with: @@ -67,6 +68,7 @@ jobs: system: aarch64-linux test_x86_64-darwin: + if: success() || failure() uses: ./.github/workflows/test.yml needs: build_x86_64-darwin with: From c134cf52dbae31e28b76f2472055d984280b63a0 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 12:25:25 -0400 Subject: [PATCH 10/10] Collapse build / test into one .yml to make skips easier --- .github/workflows/build.yml | 17 ++++++++++++++ .github/workflows/ci.yml | 35 +--------------------------- .github/workflows/test.yml | 27 --------------------- .github/workflows/upload-release.yml | 4 ++++ 4 files changed, 22 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84dbdfd79..607a31a6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,10 @@ on: required: false default: true type: boolean + run_tests: + required: false + default: true + type: boolean jobs: build: @@ -31,3 +35,16 @@ jobs: with: name: ${{ inputs.system }} path: ./tarball/*.xz + test: + if: ${{ inputs.if && inputs.run_tests}} + strategy: + fail-fast: false + runs-on: ${{ inputs.os }} + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + with: + determinate: true + - uses: DeterminateSystems/flakehub-cache-action@main + - run: nix flake check -L --system ${{ inputs.system }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bff8dcc4e..6c400f29b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,39 +51,6 @@ jobs: os: namespace-profile-mac-m2-12c28g system: aarch64-darwin - test_x86_64-linux: - uses: ./.github/workflows/test.yml - needs: build_x86_64-linux - with: - os: blacksmith-32vcpu-ubuntu-2204 - system: x86_64-linux - - test_aarch64-linux: - if: success() || failure() - uses: ./.github/workflows/test.yml - needs: build_aarch64-linux - with: - if: ${{ github.event_name == 'merge_group' }} - os: blacksmith-32vcpu-ubuntu-2204-arm - system: aarch64-linux - - test_x86_64-darwin: - if: success() || failure() - uses: ./.github/workflows/test.yml - needs: build_x86_64-darwin - with: - if: ${{ github.event_name == 'merge_group' }} - os: namespace-profile-mac-m2-12c28g - system: x86_64-darwin - - test_aarch64-darwin: - uses: ./.github/workflows/test.yml - needs: build_aarch64-darwin - with: - if: ${{ github.event_name == 'merge_group' }} - os: namespace-profile-mac-m2-12c28g - system: aarch64-darwin - vm_tests_smoke: if: github.event_name != 'merge_group' needs: build_x86_64-linux @@ -165,7 +132,7 @@ jobs: run: nix build .#hydraJobs.manual - uses: nwtgck/actions-netlify@v3.0 with: - publish-dir: './result/share/doc/nix/manual' + publish-dir: "./result/share/doc/nix/manual" production-branch: detsys-main github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: "Deploy from GitHub Actions" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 49af88020..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - workflow_call: - inputs: - os: - required: true - type: string - system: - required: true - type: string - if: - required: false - default: true - type: boolean -jobs: - tests: - if: ${{ inputs.if }} - strategy: - fail-fast: false - runs-on: ${{ inputs.os }} - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - with: - flakehub: true - - uses: DeterminateSystems/flakehub-cache-action@main - - run: nix flake check -L --system ${{ inputs.system }} diff --git a/.github/workflows/upload-release.yml b/.github/workflows/upload-release.yml index f762446bd..083f39dfd 100644 --- a/.github/workflows/upload-release.yml +++ b/.github/workflows/upload-release.yml @@ -30,24 +30,28 @@ jobs: with: os: blacksmith-32vcpu-ubuntu-2204 system: x86_64-linux + run_tests: false build-aarch64-linux: uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204-arm system: aarch64-linux + run_tests: false build-x86_64-darwin: uses: ./.github/workflows/build.yml with: os: macos-13 system: x86_64-darwin + run_tests: false build-aarch64-darwin: uses: ./.github/workflows/build.yml with: os: macos-latest system: aarch64-darwin + run_tests: false release: runs-on: ubuntu-latest