From d3e4865b107eb4c85df56095b0da1616ff4a6e34 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 10 May 2025 13:17:43 +0200 Subject: [PATCH 1/3] workflows: use ARM runners ARM runners are supposed to be more energy efficient than x86. Also, from limited testing, they appear to be faster for the eval jobs as well. Average run time for the "Outpaths (x86_64-linux)" job was 4m 27s, so far. In the first run, this job came in at 3m 9s. This effect did not show for other jobs, yet. The following two exceptions are made right now: - nixpkgs-lib-tests currently fails on the ARM runner building Nix 2.3 - nixpkgs-vet is currently pinned to a x86_64-linux only binary release --- .github/workflows/backport.yml | 2 +- .github/workflows/check-cherry-picks.yml | 2 +- .github/workflows/check-format.yml | 2 +- .github/workflows/codeowners-v2.yml | 4 ++-- .github/workflows/eval-aliases.yml | 2 +- .github/workflows/eval.yml | 16 ++++++++-------- .github/workflows/get-merge-commit.yml | 2 +- .github/workflows/labels.yml | 2 +- .github/workflows/manual-nixpkgs-v2.yml | 2 +- .github/workflows/nix-parse-v2.yml | 2 +- .github/workflows/no-channel.yml | 2 +- .github/workflows/periodic-merge.yml | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6621fd8ec8c88..0c8548d05deb7 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -15,7 +15,7 @@ jobs: backport: name: Backport Pull Request if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event.action != 'labeled' || startsWith(github.event.label.name, 'backport')) - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm steps: # Use a GitHub App to create the PR so that CI gets triggered # The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs diff --git a/.github/workflows/check-cherry-picks.yml b/.github/workflows/check-cherry-picks.yml index 1759aa5833b24..f74c83cb6ddf1 100644 --- a/.github/workflows/check-cherry-picks.yml +++ b/.github/workflows/check-cherry-picks.yml @@ -12,7 +12,7 @@ permissions: {} jobs: check: name: cherry-pick-check - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm if: github.repository_owner == 'NixOS' steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index ca3da602575b1..caa6db054e154 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -12,7 +12,7 @@ jobs: nixos: name: fmt-check - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: get-merge-commit if: needs.get-merge-commit.outputs.mergedSha steps: diff --git a/.github/workflows/codeowners-v2.yml b/.github/workflows/codeowners-v2.yml index 98c769236b221..3c0e49afb5c78 100644 --- a/.github/workflows/codeowners-v2.yml +++ b/.github/workflows/codeowners-v2.yml @@ -41,7 +41,7 @@ jobs: # Check that code owners is valid check: name: Check - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: get-merge-commit if: github.repository_owner == 'NixOS' && needs.get-merge-commit.outputs.mergedSha steps: @@ -89,7 +89,7 @@ jobs: # Request reviews from code owners request: name: Request - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm if: github.repository_owner == 'NixOS' steps: - uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31 diff --git a/.github/workflows/eval-aliases.yml b/.github/workflows/eval-aliases.yml index d9f527d0e7e21..8dfb298c6da8c 100644 --- a/.github/workflows/eval-aliases.yml +++ b/.github/workflows/eval-aliases.yml @@ -11,7 +11,7 @@ jobs: eval-aliases: name: Eval nixpkgs with aliases enabled - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: [ get-merge-commit ] steps: - name: Check out the PR at the test merge commit diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index 29ffedea5b5c1..e4b32aa4aeaf1 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -21,7 +21,7 @@ jobs: attrs: name: Attributes - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: get-merge-commit if: needs.get-merge-commit.outputs.mergedSha outputs: @@ -61,7 +61,7 @@ jobs: outpaths: name: Outpaths - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: [ attrs, get-merge-commit ] strategy: fail-fast: false @@ -70,10 +70,10 @@ jobs: steps: - name: Enable swap run: | - sudo fallocate -l 10G /swapfile - sudo chmod 600 /swapfile - sudo mkswap /swapfile - sudo swapon /swapfile + sudo fallocate -l 10G /swap + sudo chmod 600 /swap + sudo mkswap /swap + sudo swapon /swap - name: Download the list of all attributes uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -110,7 +110,7 @@ jobs: process: name: Process - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: [ outpaths, attrs, get-merge-commit ] outputs: targetRunId: ${{ steps.targetRunId.outputs.targetRunId }} @@ -212,7 +212,7 @@ jobs: # Separate job to have a very tightly scoped PR write token tag: name: Tag - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: [ attrs, process ] if: needs.process.outputs.targetRunId permissions: diff --git a/.github/workflows/get-merge-commit.yml b/.github/workflows/get-merge-commit.yml index a32595ae1ad44..cb38438cae3b3 100644 --- a/.github/workflows/get-merge-commit.yml +++ b/.github/workflows/get-merge-commit.yml @@ -11,7 +11,7 @@ permissions: {} jobs: resolve-merge-commit: - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm outputs: mergedSha: ${{ steps.merged.outputs.mergedSha }} steps: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index e3423ce169f47..d183985f07085 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -16,7 +16,7 @@ permissions: jobs: labels: name: label-pr - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')" steps: - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 diff --git a/.github/workflows/manual-nixpkgs-v2.yml b/.github/workflows/manual-nixpkgs-v2.yml index a97bd0aac7194..c3ab405c600f1 100644 --- a/.github/workflows/manual-nixpkgs-v2.yml +++ b/.github/workflows/manual-nixpkgs-v2.yml @@ -14,7 +14,7 @@ permissions: {} jobs: nixpkgs: name: nixpkgs-manual-build - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: diff --git a/.github/workflows/nix-parse-v2.yml b/.github/workflows/nix-parse-v2.yml index cc988e20bd6eb..f21d07415dc4b 100644 --- a/.github/workflows/nix-parse-v2.yml +++ b/.github/workflows/nix-parse-v2.yml @@ -11,7 +11,7 @@ jobs: tests: name: nix-files-parseable-check - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm needs: get-merge-commit if: "needs.get-merge-commit.outputs.mergedSha && !contains(github.event.pull_request.title, '[skip treewide]')" steps: diff --git a/.github/workflows/no-channel.yml b/.github/workflows/no-channel.yml index ce0d50fed15d6..c5eae3c94e7d9 100644 --- a/.github/workflows/no-channel.yml +++ b/.github/workflows/no-channel.yml @@ -13,7 +13,7 @@ jobs: startsWith(github.event.pull_request.base.ref, 'nixos-') || startsWith(github.event.pull_request.base.ref, 'nixpkgs-') name: "This PR is targeting a channel branch" - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-arm steps: - run: | cat < Date: Sat, 10 May 2025 17:06:28 +0200 Subject: [PATCH 2/3] workflows/manual-nixos: refactor matrix A bit easier to read. --- .github/workflows/manual-nixos-v2.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual-nixos-v2.yml b/.github/workflows/manual-nixos-v2.yml index 26fa03aba9b46..2be0da186aef4 100644 --- a/.github/workflows/manual-nixos-v2.yml +++ b/.github/workflows/manual-nixos-v2.yml @@ -22,12 +22,12 @@ jobs: strategy: fail-fast: false matrix: - system: - - x86_64-linux - - aarch64-linux - runs-on: >- - ${{ (matrix.system == 'x86_64-linux' && 'ubuntu-24.04') - || (matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm') }} + include: + - runner: ubuntu-24.04 + system: x86_64-linux + - runner: ubuntu-24.04-arm + system: aarch64-linux + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: From a56fa7a4a2e5980c32db9ee92f87c845458f2b97 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 10 May 2025 17:08:14 +0200 Subject: [PATCH 3/3] workflows/check-shell: test aarch64-linux and x86_64-darwin as well GitHub has all the different runners, so we can just as well check that shell.nix works. --- .github/workflows/check-shell.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-shell.yml b/.github/workflows/check-shell.yml index d148563c43110..1539df0d868b4 100644 --- a/.github/workflows/check-shell.yml +++ b/.github/workflows/check-shell.yml @@ -16,6 +16,10 @@ jobs: include: - runner: ubuntu-24.04 system: x86_64-linux + - runner: ubuntu-24.04-arm + system: aarch64-linux + - runner: macos-13 + system: x86_64-darwin - runner: macos-14 system: aarch64-darwin