ci: improved skips without breaking branch protection #3460
Labels
CI
Related to our continuous integration service (GitHub Actions)
hacktoberfest
good issue for hacktoberfest participation
So, the fix we tried in #3415 works great for the non-required jobs: skipping the windows tests on the sboms is saving us a solid hour of compute time for each sbom PR and that's the behaviour we wanted, But unfortunately when the skipped jobs are required by our branch protection rules we still wind up with SBOM PRs that can never be merged:
So, obviously those skips aren't going to work on the linux test and linux longtest jobs.
I've taken out the if statements on the required workflows as part of #3449 but while I was there I've been trying to experiment with other options. It looks like having the
if:
apply to the whole job is no good, but we are able to skip individual steps with anif:
(this is done regularly for the cache copy) so if we can figure out how to get a check in the steps instead of against the whole job that would probably work. Unfortunately, just copying the if statement down didn't seem to do what I expected (the steps I'd put the if on ran anyhow.)While I was digging around I found this workaround that might be close to what we want where you shove stuff into an environment variable to use later: https://microsoft.github.io/code-with-engineering-playbook/continuous-delivery/devops-provider-recipes/github-actions/runtime-variables/runtime-variables/ I'm not sure if we need to that here, but we'd likely want to do something like this to make the code easier to read if we're going to skip a lot of the individual steps anyhow.
I'm going to tag @raffifu in case you want to take a look at it again.
The text was updated successfully, but these errors were encountered: