mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 11:19:35 +01:00
Use a github token if possible
To prevent some API limiting
This commit is contained in:
parent
c850e982ad
commit
ec42ef03a5
2 changed files with 8 additions and 2 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
- run: |
|
||||
cachix use nixos-nix-install-tests
|
||||
CURRENT_NIX_BUILD=$(nix-build -A defaultPackage.$(nix-instantiate --eval -E '(builtins.currentSystem)'))/bin
|
||||
PATH=$CURRENT_NIX_BUILD:$PATH bash scripts/test-against-master.sh
|
||||
PATH=$CURRENT_NIX_BUILD:$PATH GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} bash scripts/test-against-master.sh
|
||||
check_cachix:
|
||||
name: Cachix secret present for installer tests
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ CurrentNixDir=$(pwd)
|
|||
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
||||
WorkDir=$(mktemp -d)
|
||||
trap 'rm -r "$WorkDir"' EXIT
|
||||
GITHUB_TOKEN_OPTION=()
|
||||
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
||||
GITHUB_TOKEN_OPTION=("--option" "access-tokens" "github.com=$GITHUB_TOKEN")
|
||||
fi
|
||||
|
||||
pushd "$WorkDir"
|
||||
|
||||
|
|
@ -22,6 +26,8 @@ cat <<EOF > flake.nix
|
|||
};
|
||||
}
|
||||
EOF
|
||||
nix --experimental-features 'nix-command flakes' flake check
|
||||
nix flake check\
|
||||
--experimental-features 'nix-command flakes' \
|
||||
"${GITHUB_TOKEN_OPTION[@]}"
|
||||
|
||||
popd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue