Skip to content

Commit 3feb491

Browse files
committed
ci: aggregate checks to avoid duplicate gateway builds
1 parent 1a6753a commit 3feb491

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

flake.nix

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,49 @@
6565
openclaw = flake-utils.lib.mkApp { drv = packageSetStable.openclaw-gateway; };
6666
};
6767

68-
checks = {
69-
gateway = packageSetStable.openclaw-gateway;
70-
package-contents = pkgs.callPackage ./nix/checks/openclaw-package-contents.nix {
71-
openclawGateway = packageSetStable.openclaw-gateway;
72-
};
73-
config-validity = pkgs.callPackage ./nix/checks/openclaw-config-validity.nix {
74-
openclawGateway = packageSetStable.openclaw-gateway;
75-
};
76-
}
77-
// (
78-
if pkgs.stdenv.hostPlatform.isLinux then
79-
{
80-
gateway-tests = pkgs.callPackage ./nix/checks/openclaw-gateway-tests.nix {
81-
sourceInfo = sourceInfoStable;
82-
};
83-
config-options = pkgs.callPackage ./nix/checks/openclaw-config-options.nix {
84-
sourceInfo = sourceInfoStable;
68+
checks =
69+
let
70+
baseChecks = {
71+
gateway = packageSetStable.openclaw-gateway;
72+
package-contents = pkgs.callPackage ./nix/checks/openclaw-package-contents.nix {
73+
openclawGateway = packageSetStable.openclaw-gateway;
8574
};
86-
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix { };
87-
hm-activation = import ./nix/checks/openclaw-hm-activation.nix {
88-
inherit pkgs home-manager;
75+
config-validity = pkgs.callPackage ./nix/checks/openclaw-config-validity.nix {
76+
openclawGateway = packageSetStable.openclaw-gateway;
8977
};
9078
}
91-
else
92-
{ }
93-
);
79+
// (
80+
if pkgs.stdenv.hostPlatform.isLinux then
81+
{
82+
gateway-tests = pkgs.callPackage ./nix/checks/openclaw-gateway-tests.nix {
83+
sourceInfo = sourceInfoStable;
84+
};
85+
config-options = pkgs.callPackage ./nix/checks/openclaw-config-options.nix {
86+
sourceInfo = sourceInfoStable;
87+
};
88+
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix { };
89+
hm-activation = import ./nix/checks/openclaw-hm-activation.nix {
90+
inherit pkgs home-manager;
91+
};
92+
}
93+
else
94+
{ }
95+
);
96+
in
97+
baseChecks
98+
// {
99+
# CI aggregator: build the expensive gateway once, then run all checks in the
100+
# same build machine/store to avoid cache-miss races between parallel jobs.
101+
ci = pkgs.symlinkJoin {
102+
name = "nix-openclaw-ci";
103+
paths = [
104+
packageSetStable.openclaw
105+
packageSetStable.openclaw-gateway
106+
packageSetStable.openclaw-tools
107+
]
108+
++ (builtins.attrValues baseChecks);
109+
};
110+
};
94111

95112
devShells.default = pkgs.mkShell {
96113
packages = [

garnix.yaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
builds:
22
include:
3-
- "packages.aarch64-darwin.openclaw"
4-
- "packages.aarch64-darwin.openclaw-gateway"
5-
- "packages.aarch64-darwin.openclaw-tools"
6-
- "packages.aarch64-darwin.openclaw-app"
7-
- "packages.x86_64-linux.openclaw"
8-
- "packages.x86_64-linux.openclaw-gateway"
9-
- "packages.x86_64-linux.openclaw-tools"
10-
- "checks.aarch64-darwin.gateway"
11-
- "checks.x86_64-linux.gateway"
12-
- "checks.x86_64-linux.gateway-tests"
13-
- "checks.x86_64-linux.config-options"
14-
- "checks.x86_64-linux.default-instance"
15-
- "checks.x86_64-linux.config-validity"
16-
- "checks.x86_64-linux.package-contents"
3+
# Single aggregator per platform.
4+
#
5+
# Avoids building openclaw-gateway multiple times across parallel CI jobs
6+
# (cache-miss races) and reduces total compute/quota usage.
7+
- "checks.aarch64-darwin.ci"
8+
- "checks.x86_64-linux.ci"

0 commit comments

Comments
 (0)