Skip to content

Commit 2431cdc

Browse files
committed
ci/check: group test-N derivations into one drv
1 parent f57d629 commit 2431cdc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

flake/dev/tests.nix

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
lib,
23
self,
34
inputs,
45
helpers,
@@ -15,6 +16,23 @@
1516

1617
# Output a build matrix for CI
1718
flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
18-
inherit (self) checks;
19+
checks = builtins.mapAttrs (
20+
system:
21+
lib.flip lib.pipe [
22+
lib.attrsToList
23+
# Group the "test-N" tests back into one drv
24+
# FIXME: drop the entire test-grouping system
25+
(builtins.groupBy ({ name, value }: if lib.strings.hasPrefix "test-" name then "test" else name))
26+
(builtins.mapAttrs (
27+
group: tests:
28+
let
29+
pkgs = inputs.nixpkgs.legacyPackages.${system};
30+
singleton = (builtins.head tests).value;
31+
joined = pkgs.linkFarmFromDrvs group (builtins.listToAttrs tests);
32+
in
33+
if builtins.length tests > 1 then joined else singleton
34+
))
35+
]
36+
) self.checks;
1937
};
2038
}

0 commit comments

Comments
 (0)