diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-01-16 23:04:26 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-01-17 10:45:23 +0100 |
commit | 9da57b5bd370a90e979453694e715975a38eb966 (patch) | |
tree | 96a345be7b2107478242f0986db58620f93f18fe /.github/workflows | |
parent | ac1638d014fdb76df76d15a6deee8687635f34a8 (diff) |
check-by-name/run-local.sh: Make it usable for non-CI platforms
Since https://github.com/NixOS/nixpkgs/pull/281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.
The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.
This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/check-by-name.yml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/.github/workflows/check-by-name.yml b/.github/workflows/check-by-name.yml index 9152a2a61708..ca2a95a2198c 100644 --- a/.github/workflows/check-by-name.yml +++ b/.github/workflows/check-by-name.yml @@ -91,8 +91,12 @@ jobs: git worktree add "$base" "$(git rev-parse HEAD^1)" echo "base=$base" >> "$GITHUB_ENV" - uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24 - - name: Fetching the tool - run: pkgs/test/nixpkgs-check-by-name/scripts/fetch-pinned-tool.sh result + - name: Fetching the pinned tool + run: | + # Get the direct /nix/store path from the pin to avoid having to evaluate Nixpkgs + toolPath=$(jq -r .ci-path pkgs/test/nixpkgs-check-by-name/scripts/pinned-tool.json) + # This asks the substituter for the path, which should be there because Hydra will have pre-built and pushed it + nix-store --realise "$toolPath" --add-root result - name: Running nixpkgs-check-by-name run: | if result/bin/nixpkgs-check-by-name --base "$base" .; then |