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

chore: reduce ci usage #480

Merged
merged 7 commits into from
Dec 11, 2024
Merged

chore: reduce ci usage #480

merged 7 commits into from
Dec 11, 2024

Conversation

JP-Ellis
Copy link
Contributor

@JP-Ellis JP-Ellis commented Dec 11, 2024

This should help reduce the CI usage by:

  1. Only running CI on either:

    • PRs targetting master
    • pushes to master

    Most importantly, CI is no longer doubled in PRs (as previously, push and pull_request would both be triggered, consuming double the number of runners).

  2. Cancelling existing runs if a new commit is added

  3. Speeding up some existing builds by not unnecessarily rebuilding everything (especially with the compatibility suite)

  4. Using nextest in place of cargo test as it is typically faster

  5. Using caching of build dependencies where possible

@JP-Ellis JP-Ellis requested a review from rholshausen December 11, 2024 08:11
@JP-Ellis JP-Ellis self-assigned this Dec 11, 2024
@JP-Ellis JP-Ellis force-pushed the chore/reduce-ci-usage branch from 99969cb to 058df48 Compare December 11, 2024 09:03
This should help reduce the CI usage by:

1. Only running  CI on either:

   - PRs targetting `master`
   - pushes to `master`

   Most importantly, CI is no longer doubled in PRs (as previously,
   `push` and `pull_request` would _both_ be triggered).

2. Cancelling existing runs if a new commit is added

Signed-off-by: JP-Ellis <[email protected]>
@JP-Ellis JP-Ellis force-pushed the chore/reduce-ci-usage branch from 058df48 to 9925028 Compare December 11, 2024 09:17
The building of dependencies takes a lot of time, providing no benefit
to splitting the CI in each version. Instead, combine them all and use
nextest to speed up tests.

Signed-off-by: JP-Ellis <[email protected]>
Nextest is typically faster to run

Signed-off-by: JP-Ellis <[email protected]>
@JP-Ellis JP-Ellis force-pushed the chore/reduce-ci-usage branch from 1519b88 to 2a5510b Compare December 11, 2024 09:43
@JP-Ellis JP-Ellis force-pushed the chore/reduce-ci-usage branch 2 times, most recently from 4c2114d to 535f174 Compare December 11, 2024 09:57
@JP-Ellis JP-Ellis force-pushed the chore/reduce-ci-usage branch from 535f174 to f80cf9f Compare December 11, 2024 10:13
@JP-Ellis JP-Ellis marked this pull request as draft December 11, 2024 10:15
@JP-Ellis JP-Ellis marked this pull request as ready for review December 11, 2024 21:06

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove that, that would be annoying. Imagine waiting for a build, then someone else pushes a commit.

Copy link
Contributor Author

@JP-Ellis JP-Ellis Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency group is per-PR, or per branch in the case of a push trigger (which would only happen in master).

So two PRs can have CI running concurrently with no issue; and if two PRs merge in quick succession, the second merge will cancel the first. But once merged, there shouldn't be any waiting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there should not be a case of waiting for a build, and it being canceled by someone else's push except if you are both working on the same PR.

If you want this to run specifically when creating tagged released, I recommend creating a separate trigger for tags.

@rholshausen rholshausen merged commit 2a99a11 into master Dec 11, 2024
24 checks passed
@rholshausen rholshausen deleted the chore/reduce-ci-usage branch December 11, 2024 23:01
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.

2 participants