Skip to content

Commit

Permalink
do some weird stuff to run the integration test script in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Nov 20, 2020
1 parent 18af59d commit b71d528
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion default.nix
Expand Up @@ -3,5 +3,28 @@
let
naersk = pkgs.callPackage sources.naersk { };
gitignore = import sources.gitignore { };
in naersk.buildPackage (gitignore.gitignoreSource ./.)

source = gitignore.gitignoreSource ./.;

# naerk's checkPhase does not have the tests directory available in checkPhase,
# so we work around it with a separate derivation. There's probably a nicer
# way around this but I don't know it right now.
package = naersk.buildPackage source;
in pkgs.stdenv.mkDerivation {
name = package.name;
version = package.version;
src = source;

buildInputs = [ package pkgs.jq ];
buildPhase = "true";

doCheck = true;
checkPhase = ''
env PATH="${package}/bin:$PATH" script/run-integration-tests.sh
'';

installPhase = ''
ln -s ${package} $out
'';
}

0 comments on commit b71d528

Please sign in to comment.