-
Notifications
You must be signed in to change notification settings - Fork 133
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: Add a cache for cargo to speed up actions #322
Conversation
While we are here: Is there any particular reason why you have left |
Codecov Report
@@ Coverage Diff @@
## main #322 +/- ##
=======================================
Coverage 53.36% 53.36%
=======================================
Files 70 70
Lines 4722 4722
=======================================
Hits 2520 2520
Misses 2202 2202 Continue to review full report at Codecov.
|
And because I rebased this PR onto main after @Nukesor merged my other CI PR, we get a neat demo of how effective the cache is :-) The initial test workflow run for this PR, the This is of course an extreme case as there are no code changes in this PR, but you should see similar speed-ups for regular PRs and commits. |
Haha :D You're having a field day over here! Thanks for bringing the CI up to speed :) Regarding Feel free to add it to all action definitions! That would definitely be quite handy. |
To be clear: you have fail-fast now, because that's the default. It's why in this build, all the steps except Test on macos-latest for aarch64-apple-ios were cancelled; the ios build failed, and that triggered a fast fail path that cancelled the other matrix members. Setting I'll add the switch to this PR. |
Also: I don't think the linter steps need to be run across all targets. cargo fmt and cargo clippy output won't vary, will they? Or are parts of the codebase conditionally ignored based on platform? |
That's the case. At least clippy only looks at the pieces of code/features that're currently included and actually compiled. I would really like to keep this in the CI, as I otherwise won't notice any linting issues in PRs, as I'm always on Linux. |
For now, clippy and fmt isn't actually executed on all platforms, but it'll be in the future, as soon as all features are implemented for the apple platforms. Right now, there're a few linting issues that can only be resolved by actually using that code. We could of course add conditional linting exceptions (if that's possible), but I didn't find the motivation to do so yet. |
Right you are! Then the matrix there is necessary and helpful.
For what it's worth: I haven't quite managed to cross-compile to However, I don't see why the codebase wouldn't pass on those platforms right now. |
The cache step here caches the cargo output as per the recommended
settings,
but with the cross-compilation target as part of the cache key, and a restore key
to take advantage of a partial cache should the cargo lock change only marginally.
Checklist
CHANGELOG.md
.cargo clippy
andcargo fmt
. The CI will fail otherwise anyway.