Improve test and build workflow with conditional execution (#381)#1219
Open
MarcosBorgesPhD wants to merge 2 commits into
Open
Improve test and build workflow with conditional execution (#381)#1219MarcosBorgesPhD wants to merge 2 commits into
MarcosBorgesPhD wants to merge 2 commits into
Conversation
- Add a `gatekeeper` job to determine whether Rust example checks and the documentation build should run. - Remove the `push.tags` trigger, as tag builds are already handled by `deploy.yml`. - Add the `workflow_call` input `skip_filters` so `deploy.yml` and `nightly.yml` can force a full build and bypass the gatekeeper. - Update the `check-rust-examples` and `build` jobs to run conditionally based on the gatekeeper output.
✅ Deploy Preview for scrc-coding-guidelines ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the
build-guidelines.ymlworkflow by avoiding unnecessary tests when they are not needed. This is a first step toward addressing Issue #381.The goal is not just to save compute time. It is also to avoid running unnecessary jobs that can slow down or block contributors because of unrelated issues elsewhere in the codebase.
What changed
A
gatekeeperjob now determines whether the checks need to run.When relevant files change:
check-rust-examplesrunsbuildrunsOtherwise, those jobs are skipped.
Warning
We need to check whether the GitHub branch protection settings accept
buildreportingsuccess,failure, and nowskipped.The
gatekeeperwas chosen instead ofpathsfilters to keep thebuildstatus always reported for PRs. Withpaths, the workflow could be skipped entirely, leaving GitHub without a status to evaluate for merge/branch protection.The
pushtag trigger was removed since tag builds are already covered byworkflow_callfromdeploy.yml.A
force_full_buildinput (default:true) was added toworkflow_callallowingdeploy.ymlandnightly.ymlto bypass the gatekeeper and force a full build when needed.Files that trigger a full build
The workflow currently watches the following paths:
src/(kept intentionally broad to avoid edge cases)builder/exts/tests/rust-examples/scripts/extract_rust_examples.pyscripts/migrate_rust_examples.py.github/workflows/build-guidelines.yml.github/workflows/check-rust-examples.ymlmake.pyspec.lockpyproject.tomluv.lockThere are several dependencies between the build scripts and the documentation, so I’d rather err on the side of running the build than accidentally missing a case. If we discover additional dependencies later, we can easily expand the watched paths.
I’ll keep monitoring the workflow after this lands to make sure there aren’t any unexpected side effects. 😅