about summary refs log tree commit diff
path: root/.github
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-12-16 03:01:03 +0100
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-12-19 23:15:01 +0100
commit3869ba41274265150be6f9e233ae5f8f35f867ee (patch)
tree4b957376c8e577a0c243920f79290bd7b73b4947 /.github
parent2a107bc64b22101157cad353272495add0947a59 (diff)
downloadnixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar.gz
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar.bz2
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar.lz
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar.xz
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.tar.zst
nixlib-3869ba41274265150be6f9e233ae5f8f35f867ee.zip
workflows/check-by-name: Move tool fetching into script
This part of the CI can also be reproduced locally
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/check-by-name.yml36
1 files changed, 2 insertions, 34 deletions
diff --git a/.github/workflows/check-by-name.yml b/.github/workflows/check-by-name.yml
index 294775fa1c8e..43237d36bee1 100644
--- a/.github/workflows/check-by-name.yml
+++ b/.github/workflows/check-by-name.yml
@@ -79,40 +79,8 @@ jobs:
 
           echo "headSha=$(git rev-parse HEAD^2)" >> "$GITHUB_ENV"
       - uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
-      - name: Determining channel to use for dependencies
-        run: |
-          echo "Determining the preferred channel to use for PR base branch $GITHUB_BASE_REF"
-          if [[ "$GITHUB_BASE_REF" =~ ^(release|staging|staging-next)-([0-9][0-9]\.[0-9][0-9])$ ]]; then
-              # Use the release channel for all PRs to release-XX.YY, staging-XX.YY and staging-next-XX.YY
-              channel=nixos-${BASH_REMATCH[2]}
-              echo "PR is for a release branch, preferred channel is $channel"
-          else
-              # Use the nixos-unstable channel for all other PRs
-              channel=nixos-unstable
-              echo "PR is for a non-release branch, preferred channel is $channel"
-          fi
-          # Check that the channel exists. It doesn't exist for fresh release branches
-          if ! curl -fSs "https://channels.nixos.org/$channel"; then
-            # Fall back to nixos-unstable, makes sense for fresh release branches
-            echo "Preferred channel $channel could not be fetched, falling back to nixos-unstable"
-            channel=nixos-unstable
-          fi
-          echo "channel=$channel" >> "$GITHUB_ENV"
-      - name: Fetching latest version of channel
-        run: |
-          echo "Fetching latest version of channel $channel"
-          # This is probably the easiest way to get Nix to output the path to a downloaded channel!
-          nixpkgs=$(nix-instantiate --find-file nixpkgs -I nixpkgs=channel:"$channel")
-          # This file only exists in channels
-          rev=$(<"$nixpkgs"/.git-revision)
-          echo "Channel $channel is at revision $rev"
-          echo "nixpkgs=$nixpkgs" >> "$GITHUB_ENV"
-          echo "rev=$rev" >> "$GITHUB_ENV"
-      - name: Fetching pre-built nixpkgs-check-by-name from the channel
-        run: |
-          echo "Fetching pre-built nixpkgs-check-by-name from channel $channel at revision $rev"
-          # Passing --max-jobs 0 makes sure that we won't build anything
-          nix-build "$nixpkgs" -A tests.nixpkgs-check-by-name --max-jobs 0
+      - name: Fetching the tool
+        run: pkgs/test/nixpkgs-check-by-name/scripts/fetch-tool.sh "$GITHUB_BASE_REF" result
       - name: Running nixpkgs-check-by-name
         run: |
           echo "Checking whether the check succeeds on the base branch $GITHUB_BASE_REF"