Skip to content

Add cargo check on CI #349

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

WilliamTakeshi
Copy link
Contributor

This PR introduces cargo check.

My plan is to gradually increase the coverage over multiple PRs and eventually add Clippy. Through these changes, I'm also familiarizing myself with the codebase.

seems like we don't have a easy substitution, so i will just mark as
allow and will fix it in the future
Copy link
Collaborator

@chrysn chrysn left a comment

Choose a reason for hiding this comment

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

That looks like a good change as a whole.

@@ -18,6 +18,8 @@ jobs:
uses: actions/checkout@v4
- name: Install Rust formatter
run: rustup component add rustfmt
- name: Run cargo check
run: cargo check
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be --workspace, and eventually fail (and not just show, nobody reads CI logs) if something is spotted.

Currently, wouldn't go through due to lakers-c apparently being embedded-only, but that should be fixable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

… and maybe with a second --all-features pass, but that too currently fails :-/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @chrysn , thanks for the feedback!

I’ve added RUSTFLAGS=-Dwarnings to the CI so that any warnings will now cause the build to fail.

I also added the --all-features flag to the check. The main change is in how the Crypto type is selected. Previously, the features "psa", "rustcrypto", and "cryptocell310" were mutually exclusive. I’ve switched to using cfg_if! to make them additive instead — though this introduces an implicit priority order. Let me know if the project prefers to keep them mutually exclusive instead.

I plan to add --workspace in the future, but for now I’m holding off as I’m not yet confident making changes to that part.

@geonnave
Copy link
Collaborator

Thanks for this PR, improving warnings and cleaning the codebase is very welcome.

I just saw emails that some of my github tokens expired. I just updated them. I hope the CI will be ok!

(I am in the middle of some weeks of mission abroad / PTO, doing some catch up now!)

@WilliamTakeshi WilliamTakeshi requested a review from chrysn April 13, 2025 19:53
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.

3 participants