Hello,
I’m writing a workflow that has a large number of steps. We currently have 38 steps and I expect this number to grow.
In this workflow, we have a Script step that evaluates which files have changed and sets an environment variable (one for each Step) based on whether we detect changes relevant to that Step.
e.g. Something like “if any files in module A have changed, then call envman to set RUN_A:true”
While this works correctly to selectively run the various Steps, it takes approximately 20 seconds to evaluate each run_if
statement. With 38 steps to check, this adds up quickly to over 10 minutes spent doing nothing.
Each Step is a custom step that I have written and host in its own repository. I’m speculating that the Step is being cloned prior to evaluating the run_if
. Is that correct?
Is there any way to get the run_if
to be evaluated before the Step is cloned?
Here is a snippet of one of the Steps from our bitrise.yml
- git::https://github.com/[REDACTED/[REDACTED].git@main:
title: 'Trigger: Feature Login'
run_if: '{{getenv "skip-test-worker-login" | eq "false"}}'
Here is a sample from our logs:
+------------------------------------------------------------------------------+
| (17) Trigger: Feature Login |
+---+---------------------------------------------------------------+----------+
+---+---------------------------------------------------------------+----------+
| - | Trigger: Feature Login | 17.87 sec|
+---+---------------------------------------------------------------+----------+
▼
WARN[20:20:31] The step's (Trigger: Feature Login) Run-If expression evaluated to false - skipping
INFO[20:20:31] The Run-If expression was: {{getenv "skip-test-worker-login" | eq "false"}}
+------------------------------------------------------------------------------+
| (18) Trigger: Feature Notifications |
+------------------------------------------------------------------------------+
| id: https://github.com/[REDACTED].git |
| version: main |
| collection: git |
| toolkit: go |
| time: 2021-10-18T20:20:49Z |
+------------------------------------------------------------------------------+
| |
WARN[20:20:49] The step's (Trigger: Feature Notifications) Run-If expression evaluated to false - skipping
INFO[20:20:49] The Run-If expression was: {{getenv "skip-test-worker-notifications" | eq "false"}}
| |
+---+---------------------------------------------------------------+----------+
| - | Trigger: Feature Notifications | 17.66 sec|
+---+---------------------------------------------------------------+----------+