Refactor Qcode CI to Combine Jobs#12
Merged
Merged
Conversation
nicky-johnstone
commented
Feb 23, 2023
| id: check-line-length | ||
| if: > | ||
| always() | ||
| && steps.changed-files.outcome == 'success' |
Member
Author
There was a problem hiding this comment.
This has been added to every linting step so that if one linting step fails then it will not prevent any other linting steps from running.
always() makes the step always run regardless of whether the job has been cancelled or if any previous steps have failed.
&& steps.changed-files.outcome == 'success' checks that the changed files action has succeeded. This is important because we only really want each linting step to run if the shared setup steps (i.e. dependency installation, repo checkouts, and ) have been successful. If the last step in the shared setup successfully runs then it means that the steps prior to it have also successfully run.
Member
Author
Examples of FeedbackCheck Proc Body LengthsCheck File LengthsCheck Proc Name PrefixesCheck Each Proc Has A Unit TestCheck Line Lengths |
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.
Successful run:
https://github.com/qcode-software/ci-development/actions/runs/4252744259/jobs/7396712578
Run with some steps failing due to linting not passing:
https://github.com/qcode-software/ci-development/actions/runs/4252725650/jobs/7396670208
Motivation for Change
If the qcode-ci workflow is run in a private repository then GitHub bills for time taken to run each job with a minimum billing of 1 minute if I recall correctly.
The current setup will run 5 different jobs (one for each linting check) and while the Tcl scripts take trivial time to run the set up for each job takes ~30 seconds meaning a typical bill per run in a private repository is 5 minutes.
This new setup only runs one job and all of the linting checks get to reuse the setup therefore a bill for a typical run in a private repository should be reduced to just 1 minute.
Testing