mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 19:29:36 +01:00
Try to replicate as closely as possible the CI setup
So that the hashes match
This commit is contained in:
parent
ec42ef03a5
commit
274a7be8d5
2 changed files with 12 additions and 18 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
|
@ -22,11 +22,9 @@ jobs:
|
||||||
name: '${{ env.CACHIX_NAME }}'
|
name: '${{ env.CACHIX_NAME }}'
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
- run: cachix use nixos-nix-install-tests
|
||||||
- run: nix-build -A checks.$(nix-instantiate --eval -E '(builtins.currentSystem)')
|
- run: nix-build -A checks.$(nix-instantiate --eval -E '(builtins.currentSystem)')
|
||||||
- run: |
|
- run: bash scripts/test-against-master.sh
|
||||||
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 GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} bash scripts/test-against-master.sh
|
|
||||||
check_cachix:
|
check_cachix:
|
||||||
name: Cachix secret present for installer tests
|
name: Cachix secret present for installer tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ set -x;
|
||||||
CurrentNixDir=$(pwd)
|
CurrentNixDir=$(pwd)
|
||||||
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
||||||
WorkDir=$(mktemp -d)
|
WorkDir=$(mktemp -d)
|
||||||
trap 'rm -r "$WorkDir"' EXIT
|
trap 'rm -rf "$WorkDir"' EXIT
|
||||||
GITHUB_TOKEN_OPTION=()
|
GITHUB_TOKEN_OPTION=()
|
||||||
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
||||||
GITHUB_TOKEN_OPTION=("--option" "access-tokens" "github.com=$GITHUB_TOKEN")
|
GITHUB_TOKEN_OPTION=("--option" "access-tokens" "github.com=$GITHUB_TOKEN")
|
||||||
|
|
@ -14,20 +14,16 @@ fi
|
||||||
|
|
||||||
pushd "$WorkDir"
|
pushd "$WorkDir"
|
||||||
|
|
||||||
cat <<EOF > flake.nix
|
git clone "https://github.com/nixos/nix"
|
||||||
{
|
|
||||||
inputs.currentNix.url = "git+file://$CurrentNixDir?rev=$CurrentRev";
|
|
||||||
inputs.nixMaster.url = "github:nixos/nix";
|
|
||||||
|
|
||||||
outputs = { self, currentNix, nixMaster }: {
|
cat <<EOF > default.nix
|
||||||
checks = builtins.mapAttrs (systemName: _:
|
let
|
||||||
{ againstMaster = currentNix.lib.testAgainst.\${systemName} nixMaster.defaultPackage.\${systemName}; }
|
currentNix = import $CurrentNixDir;
|
||||||
) currentNix.defaultPackage;
|
masterNix = import ./nix;
|
||||||
};
|
in
|
||||||
}
|
currentNix.lib.testAgainst.\${builtins.currentSystem} masterNix.defaultPackage.\${builtins.currentSystem}
|
||||||
EOF
|
EOF
|
||||||
nix flake check\
|
|
||||||
--experimental-features 'nix-command flakes' \
|
nix-build "${GITHUB_TOKEN_OPTION[@]}"
|
||||||
"${GITHUB_TOKEN_OPTION[@]}"
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue