Skip to content

Commit aa4a3a2

Browse files
committed
Unflatten hydraJobs and add ciJobs
It turns out it is nice to use system first in the hierarchy for cicero. Also both hydra and cicero are ok with a deep hierarchy of attributes.
1 parent 71cb0b9 commit aa4a3a2

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

lib/default.nix

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ in {
370370
value = flake.devShells.${n};
371371
}) (__attrNames flake.devShells));
372372
} // lib.optionalAttrs (flake ? hydraJobs) {
373-
hydraJobs = prefixAttrs (prefix + sep) flake.hydraJobs;
373+
hydraJobs.${lib.removeSuffix ":" prefix} = flake.hydraJobs;
374374
};
375375

376376
# Used by `combineFlakes` to combine flakes together
@@ -414,6 +414,27 @@ in {
414414
{ name = "${packageName}:test:${n}"; value = v; })
415415
(lib.filterAttrs (_: v: lib.isDerivation v) (package.checks))
416416
) (packageNames project));
417+
ciJobs = {
418+
# Run all the tests
419+
inherit checks;
420+
# Build tools and cache tools needed for the project
421+
inherit (project) roots;
422+
# Also build and cache any tools in the `devShell`
423+
devShell = project.shell;
424+
# Run HPC on the tests
425+
coverage = builtins.listToAttrs (lib.concatMap (packageName: [{
426+
name = packageName;
427+
value = coverageProject.hsPkgs.${packageName}.coverageReport;
428+
}]) (packageNames coverageProject));
429+
}
430+
# Build the plan-nix and check it if materialized
431+
// lib.optionalAttrs (checkedProject ? plan-nix) {
432+
plan-nix = checkedProject.plan-nix;
433+
}
434+
# Build the stack-nix and check it if materialized
435+
// lib.optionalAttrs (checkedProject ? stack-nix) {
436+
stack-nix = checkedProject.stack-nix;
437+
};
417438
in {
418439
# Used by:
419440
# `nix build .#pkg-name:lib:pkg-name`
@@ -456,33 +477,11 @@ in {
456477
{ name = "${packageName}:benchmark:${n}"; value = { type = "app"; program = v.exePath; }; })
457478
(package.components.benchmarks)
458479
) (packageNames project));
459-
# Used by hydra and cicero:
460-
hydraJobs =
461-
prefixAttrs "checks:" checks
462-
463-
# Build the plan-nix and check it if materialized
464-
// lib.optionalAttrs (checkedProject ? plan-nix) {
465-
plan-nix = checkedProject.plan-nix;
466-
}
467-
468-
# Build the stack-nix and check it if materialized
469-
// lib.optionalAttrs (checkedProject ? stack-nix) {
470-
stack-nix = checkedProject.stack-nix;
471-
}
472-
473-
// {
474-
# Build tools and cache tools needed for the project
475-
inherit (project) roots;
476-
# Also build and cache any tools in the `devShell`
477-
devShell = project.shell;
478-
}
479-
480-
# Run HPC on the tests
481-
// builtins.listToAttrs (lib.concatMap (packageName: [{
482-
name = "coverage:" + packageName;
483-
value = coverageProject.hsPkgs.${packageName}.coverageReport;
484-
}]) (packageNames coverageProject))
485-
;
480+
# Used by hydra.
481+
hydraJobs = ciJobs;
482+
# Like `hydraJobs` but with system first so that it the IFDs will not have
483+
# to form systems we are not testing.
484+
inherit ciJobs;
486485
devShells.default = project.shell;
487486
devShell = project.shell;
488487
};

0 commit comments

Comments
 (0)