Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@
checks.x86_64-linux.lint = import ./nix/lint {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
};
checks.x86_64-linux.test-suite = import ./nix/test-suite-check.nix {
inherit nixpkgs nix-editor;
system = "x86_64-linux";
};
};
}
6 changes: 0 additions & 6 deletions nix-ci.nix

This file was deleted.

45 changes: 45 additions & 0 deletions nix/test-suite-check.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ nixpkgs, nix-editor, system }:
let
pkgs = nixpkgs.legacyPackages.${system};
src = pkgs.lib.fileset.toSource {
root = ../.;
fileset = pkgs.lib.fileset.unions [
../cmd
../internal
../resources
../test-suite
../go.mod
../go.sum
../Makefile
];
};
# The release version includes the Git revision; unrelated commits should
# not invalidate the test binary or the check.
packages = import ./default.nix {
inherit nixpkgs nix-editor system;
self = src;
rev = "0.0.0-test";
};
suite = pkgs.runCommand "upm-integration-check" {
nativeBuildInputs = [ pkgs.cacert ];
} ''
export HOME="$TMPDIR/home"
mkdir -p "$HOME"
cp -R ${src} source
chmod -R u+w source
cd source
${packages.test-suite}/bin/upm-test-suite
'';
# A fixed-output build may use the network. Key its only output to the
# ordinary derivation so changing any declared input invalidates success.
marker = builtins.unsafeDiscardStringContext (builtins.baseNameOf suite.drvPath);
in
suite.overrideAttrs (old: {
outputHashAlgo = "sha256";
outputHashMode = "flat";
outputHash = builtins.hashString "sha256" marker;
preferHashedMirrors = false;
buildCommand = old.buildCommand + ''
printf '%s' '${marker}' > "$out"
'';
})
Loading