Skip to content

Commit

Permalink
Make the aggregate jobs end with -aggregate so we don't build those
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Jul 10, 2024
1 parent 230a31a commit 3d1f53e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nix flake show --json --all-systems \
map(select(.[0][-1] == "type" and .[1] == "derivation")
| .[0][0:-1] # Take each attribute name and drop `type`
| select(.[-1] != "all") # Skip attributes which are `all` jobs, presumably combining other jobs
| select(.[-1] | endswith("-aggregate") != true) # Skip attributes which end in `-aggregate`, because those just depend on other jobs which build them
| select(.[0] == "hydraJobs") # Select the hydraJobs which are not typically run in CI
| {
attribute: . | join("."),
Expand Down
16 changes: 8 additions & 8 deletions nix/tests/vm-test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,15 @@ let
touch $out
'';

makeTests = name: tests: builtins.mapAttrs
makeTests = name: tests: imagePredicate: builtins.mapAttrs
(imageName: image:
rec {
${image.system} = (builtins.mapAttrs
(testName: test:
makeTest imageName testName test
)
tests) // {
"${name}" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.releaseTools.aggregate {
"${name}-aggregate" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.releaseTools.aggregate {
name = name;
constituents = (
pkgs.lib.mapAttrsToList
Expand All @@ -621,17 +621,17 @@ let
};
}
)
images;
(lib.filterAttrs imagePredicate images);

allCases = lib.recursiveUpdate (lib.recursiveUpdate installCases (lib.recursiveUpdate cureSelfCases cureScriptCases)) uninstallCases;

install-tests = makeTests "install" installCases;
install-tests = makeTests "install" installCases (_: _: true);

cure-self-tests = makeTests "cure-self" cureSelfCases;
cure-self-tests = makeTests "cure-self" cureSelfCases (_: _: true);

cure-script-tests = makeTests "cure-script" cureScriptCases;
cure-script-tests = makeTests "cure-script" cureScriptCases (_name: { upstreamScriptsWork ? true, ... }: upstreamScriptsWork);

uninstall-tests = makeTests "uninstall" uninstallCases;
uninstall-tests = makeTests "uninstall" uninstallCases (_: _: true);

all-tests = builtins.mapAttrs
(imageName: image: {
Expand All @@ -652,7 +652,7 @@ in
lib.recursiveUpdate joined-tests {
all."x86_64-linux" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.lib.mapAttrs (caseName: case:
pkgs.releaseTools.aggregate {
name = caseName;
name = "${caseName}-aggregate";
constituents = pkgs.lib.mapAttrsToList (name: value: value."x86_64-linux"."${caseName}") joined-tests;
}
)) (allCases // { "cure-self" = { }; "cure-script" = { }; "install" = { }; "uninstall" = { }; "all" = { }; });
Expand Down

0 comments on commit 3d1f53e

Please sign in to comment.