-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecks.nix
More file actions
57 lines (51 loc) · 1.06 KB
/
checks.nix
File metadata and controls
57 lines (51 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
pkgs,
stdenv,
python3Packages,
merise_dot ? pkgs.callPackage ./default.nix { },
...
}:
let
reports = stdenv.mkDerivation {
name = "merise_dot-behave-checks";
# build info
src = ./.;
nativeBuildInputs =
with pkgs;
with python3Packages;
[
behave
coverage
merise_dot
# build deps
graphviz
];
# actual build
buildPhase = ''
coverage run --source="./merise_dot" -m behave --junit -t "not @wip" || true
'';
# everything to reports
installPhase = ''
mkdir -p $out
coverage xml -o $out/coverage
coverage report > $out/coverage.txt
cp -r reports $out/
'';
};
in
stdenv.mkDerivation {
name = "merise_dot-behave-res";
src = reports.out;
dontInstall = true; # these are test reports, not a binary
# build reports
buildPhase = ''
if grep 'status="failed"' reports/*
then
exit 1
else
touch $out
fi
'';
# small passthru utility to ensure we get access to reports
passthru = { inherit reports; };
}