refactor(nix/buildkite): Optimise steps if builds are not enabled

Generating a release-only pipeline skips a bigger chunk of eval this
way (the step itself is never actually evaluated, which means we never
actually compute the drv), which can be quite beneficial in terms of
evaluation time.

Change-Id: I2739026ddd1c6a86f82627ac26a046c5fe7359ea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5830
Tested-by: BuildkiteCI
Reviewed-by: ezemtsov <eugene.zemtsov@gmail.com>
This commit is contained in:
Vincent Ambo 2022-06-02 17:51:58 +00:00 committed by tazjin
parent df83e3d556
commit b9c31d6658

View file

@ -191,7 +191,8 @@ rec {
map (mkExtraStep buildEnabled) steps)
splitExtraSteps;
in
extraSteps // {
if !buildEnabled then extraSteps
else extraSteps // {
build = [ step ] ++ (extraSteps.build or [ ]);
};