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: add clippy and update toolchain install action. #1062

Merged
merged 5 commits into from
Feb 28, 2023

Conversation

ThomasFrans
Copy link
Contributor

@ThomasFrans ThomasFrans commented Feb 23, 2023

  • Update all the actions to the latest version since some of them were using deprecated stuff.
  • Use a different Rust toolchain installation action because the previous one is no longer maintained and generated deprecated warnings. The new one is by dtolnay (the author of the syn, anyhow and cargo-expand) so it will probably be maintained for a while 🙂
  • Fix the last clippy warning that occurred by enabling all features.
  • Cache the build artifacts as long as the dependencies don't change.
  • Build the project instead of just checking it (I'm not sure but I think just checking can miss errors under some circumstances. Some projects check, others build.). Building doesn't add much extra time when caching the target directory anyways.

I hope this is ok. This is only my second GitHub CI config I've worked on so if anything isn't right, I'll happily change it 🙂

The first run without any caches took around 10m for me, subsequent runs take around 3m40s as long as the Cargo.lock file doesn't change (which invalidates the dependency artifact caches).

Also it might be necessary to manually delete the latest caches (the ones that were used in the last while) as I don't think they will be updated with the target directory otherwise...

closes #1051

Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

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

Great! Thanks for tackling this. I have some minor comments below.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@ThomasFrans
Copy link
Contributor Author

I'll update the things you mentioned (or you can do it if you prefer).

Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

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

Merged, thank you! :)

@hrkfdn hrkfdn merged commit 9ca72e3 into hrkfdn:main Feb 28, 2023
@ThomasFrans ThomasFrans deleted the add-clippy-to-ci branch February 28, 2023 22:01
@ThomasFrans
Copy link
Contributor Author

Merged, thank you! :)

I think you might have to clear out the current job cache once (the ones used in the last while, as I don't remember if there is a clear all button). I had some problems where the clippy and build files were using the same cache tag which isn't correct.

@hrkfdn
Copy link
Owner

hrkfdn commented Feb 28, 2023

Thanks for the heads up, I'll update the Cargo.lock via a dependency update which should change the cache key, right?

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.

Prevent clippy warnings by integrating into CI.
2 participants