mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 11:19:35 +01:00
Run the tests as a separate flake
Avoids needing the `--impure` flag, and hopefully makes everything more nicely cached
This commit is contained in:
parent
3130e8dc4c
commit
c850e982ad
2 changed files with 29 additions and 5 deletions
27
scripts/test-against-master.sh
Executable file
27
scripts/test-against-master.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x;
|
||||
|
||||
CurrentNixDir=$(pwd)
|
||||
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
||||
WorkDir=$(mktemp -d)
|
||||
trap 'rm -r "$WorkDir"' EXIT
|
||||
|
||||
pushd "$WorkDir"
|
||||
|
||||
cat <<EOF > flake.nix
|
||||
{
|
||||
inputs.currentNix.url = "git+file://$CurrentNixDir?rev=$CurrentRev";
|
||||
inputs.nixMaster.url = "github:nixos/nix";
|
||||
|
||||
outputs = { self, currentNix, nixMaster }: {
|
||||
checks = builtins.mapAttrs (systemName: _:
|
||||
{ againstMaster = currentNix.lib.testAgainst.\${systemName} nixMaster.defaultPackage.\${systemName}; }
|
||||
) currentNix.defaultPackage;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
nix --experimental-features 'nix-command flakes' flake check
|
||||
|
||||
popd
|
||||
Loading…
Add table
Add a link
Reference in a new issue