ci/check: group test-N derivations into one drv

This commit is contained in:
Matt Sturgeon 2025-05-25 17:56:54 +01:00
parent f57d629bb0
commit 2431cdc047
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,4 +1,5 @@
{ {
lib,
self, self,
inputs, inputs,
helpers, helpers,
@ -15,6 +16,23 @@
# Output a build matrix for CI # Output a build matrix for CI
flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
inherit (self) checks; checks = builtins.mapAttrs (
system:
lib.flip lib.pipe [
lib.attrsToList
# Group the "test-N" tests back into one drv
# FIXME: drop the entire test-grouping system
(builtins.groupBy ({ name, value }: if lib.strings.hasPrefix "test-" name then "test" else name))
(builtins.mapAttrs (
group: tests:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
singleton = (builtins.head tests).value;
joined = pkgs.linkFarmFromDrvs group (builtins.listToAttrs tests);
in
if builtins.length tests > 1 then joined else singleton
))
]
) self.checks;
}; };
} }