Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Only run jobs for selected roles #4075

Merged
merged 9 commits into from
Mar 22, 2023
Merged

Conversation

peterargue
Copy link
Contributor

@peterargue peterargue commented Mar 21, 2023

The original version would spawn jobs and do all of the pre-build steps for all roles, wasting runner resources. This change:

  • Only creates jobs for roles that were selected
  • Skips building relic on the node runner since it is already run during the docker builds

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2023

Codecov Report

Merging #4075 (f88e48a) into master (50a5267) will decrease coverage by 2.37%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4075      +/-   ##
==========================================
- Coverage   53.49%   51.12%   -2.37%     
==========================================
  Files         831      669     -162     
  Lines       77720    59929   -17791     
==========================================
- Hits        41575    30640   -10935     
+ Misses      32816    26833    -5983     
+ Partials     3329     2456     -873     
Flag Coverage Δ
unittests 51.12% <ø> (-2.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 172 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sjonpaulbrown
Copy link
Collaborator

If we were to shift the build selected step in a job, we could streamline this and remove the need for the conditional if: env.role_enabled steps. If the role is to be built, we add that role to an array which would be used as the value of the matrix.

This would ensure that jobs are only executed for roles that are to be built. It would "cleanup" the execution so that unnecessary jobs are not displayed in the workflow execution, and it would remove the complexity of the conditional statements.

Here is a StackOverflow post for a reference of "dynamic" matrix values from a previous job.

@peterargue peterargue changed the title [CI] Fail node builds fast for unselected roles [CI] Only run jobs for unselected roles Mar 21, 2023
@peterargue peterargue changed the title [CI] Only run jobs for unselected roles [CI] Only run jobs for selected roles Mar 21, 2023
@peterargue
Copy link
Contributor Author

bors merge

@bors bors bot merged commit 1f96328 into master Mar 22, 2023
@bors bors bot deleted the petera/only-build-when-selected branch March 22, 2023 17:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants