From 9da57b5bd370a90e979453694e715975a38eb966 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 16 Jan 2024 23:04:26 +0100 Subject: 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. --- .github/workflows/check-by-name.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/check-by-name.yml b/.github/workflows/check-by-name.yml index 9152a2a61708e..ca2a95a2198c3 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 -- cgit 1.4.1