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

Improve CI cache #1151

Merged
merged 2 commits into from
Sep 8, 2021
Merged

Improve CI cache #1151

merged 2 commits into from
Sep 8, 2021

Conversation

baptiste0928
Copy link
Member

I noticed that the cache used for the CI was inefficient : all dependencies are recompiled each time, with make the CI very long to run. This PR replaces the existing cache with the Swatinem/rust-cache action, that correctly cache dependencies. This cache is used in other big projects like rust-anlayser.

Example CI run of my last PR. Although there is other previous commits on the branch and no dependency has been updated, all dependencies are being downloaded and compiled again.

image

@baptiste0928
Copy link
Member Author

baptiste0928 commented Sep 6, 2021

I think that cargo-sync-readme could also be cached to avoid downloading and compiling it each time. Unfortunalety, actions-rs/install does not yet support GitHub caching (actions-rs/install#5).

An empty commit to trigger CI and ensure the cache works well.
@BlackHoleFox BlackHoleFox added c-all Affects all crates or the project as a whole t-ci Anything to do with CI. labels Sep 8, 2021
@7596ff 7596ff merged commit 92105c5 into twilight-rs:main Sep 8, 2021
@baptiste0928 baptiste0928 deleted the ci-cache branch September 9, 2021 06:51
MaxOhn pushed a commit to MaxOhn/twilight that referenced this pull request Oct 7, 2021
I noticed that the cache used for the CI was inefficient: all dependencies are recompiled each time, which made the CI very long to run.

This PR replaces the existing cache with the [`Swatinem/rust-cache`](https://github.com/Swatinem/rust-cache/) action, that correctly cache dependencies. This cache is used in [other big projects](https://github.com/rust-analyzer/rust-analyzer/blob/b73b321478d3b2a98d380eb79de717e01620c4e9/.github/workflows/ci.yaml#L53-L54) like `rust-analyzer`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-all Affects all crates or the project as a whole t-ci Anything to do with CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants