Compare commits

...
Author SHA1 Message Date
regnat 274a7be8d5 Try to replicate as closely as possible the CI setup
So that the hashes match
2021-09-22 18:00:06 +02:00
regnat ec42ef03a5 Use a github token if possible
To prevent some API limiting
2021-09-22 18:00:06 +02:00
regnat c850e982ad Run the tests as a separate flake
Avoids needing the `--impure` flag, and hopefully makes everything more
nicely cached
2021-09-22 18:00:06 +02:00
regnat 3130e8dc4c Fetch Nix master from the cachix cache
Rather than rebuilding it each time
2021-09-22 18:00:06 +02:00
regnat 3b6ed967df Give the gh action access to a github token
Otherwise fetching the master branch will most likely fail because of
rate-limiting
2021-09-22 18:00:06 +02:00
regnat 95477d7711 Test using the current system, not an hardcoded one 2021-09-22 18:00:06 +02:00
regnat 9776693c4f Actually test against master
And not against ourself
2021-09-22 18:00:06 +02:00
regnat 8586ef5a3c Add a missing pair of parens 2021-09-22 18:00:06 +02:00
regnat 5411aaf293 Fix the indentation of the yaml file 2021-09-22 18:00:06 +02:00
regnat f4638b64a1 Add a github action step to run the tests against current master 2021-09-22 18:00:06 +02:00
3 changed files with 37 additions and 0 deletions

No files matched your search

+2
View File
@@ -22,7 +22,9 @@ jobs:
name: '${{ env.CACHIX_NAME }}'
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: cachix use nixos-nix-install-tests
- run: nix-build -A checks.$(nix-instantiate --eval -E '(builtins.currentSystem)')
- run: bash scripts/test-against-master.sh
check_cachix:
name: Cachix secret present for installer tests
runs-on: ubuntu-latest
+6
View File
@@ -504,6 +504,12 @@
} "touch $out";
});
lib = {
testAgainst = forAllSystems (system:
testNixVersions nixpkgsFor.${system} nixpkgsFor.${system}.nix
);
};
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) nix;
} // (nixpkgs.lib.optionalAttrs (builtins.elem system linux64BitSystems) {
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
set -x;
CurrentNixDir=$(pwd)
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
WorkDir=$(mktemp -d)
trap 'rm -rf "$WorkDir"' EXIT
GITHUB_TOKEN_OPTION=()
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
GITHUB_TOKEN_OPTION=("--option" "access-tokens" "github.com=$GITHUB_TOKEN")
fi
pushd "$WorkDir"
git clone "https://github.com/nixos/nix"
cat <<EOF > default.nix
let
currentNix = import $CurrentNixDir;
masterNix = import ./nix;
in
currentNix.lib.testAgainst.\${builtins.currentSystem} masterNix.defaultPackage.\${builtins.currentSystem}
EOF
nix-build "${GITHUB_TOKEN_OPTION[@]}"
popd