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

[Rust]: Setup CI steps #3035

Merged
merged 39 commits into from
Mar 31, 2023
Merged

[Rust]: Setup CI steps #3035

merged 39 commits into from
Mar 31, 2023

Conversation

satoshiotomakan
Copy link
Collaborator

@satoshiotomakan satoshiotomakan commented Mar 28, 2023

Description

As we want to write more rust, we will have to ensure the robustness of our implementations. to do this we need cargo caching, run the rust unit tests and display them on the CI, the clippy checks and finally the coverage check.

Checklist

  • cargo caching (only for Linux Rust CI)
  • run rust unit tests
  • unit tests report in the CI
  • clippy check in the CI
  • coverage check + report CI

TODO

  • Consider installing only target required toolchains. For example, install aarch64-apple-darwin x86_64-apple-darwin for iOS CI only.
  • Consider caching rust/target between each branch to improve compilation time. We can schedule a clean build every night to recompile the rust/target cache.

Notes

Test coverage requires cargo-llvm-cov package (therefore llvm-tools-preview rustup tool) and nightly toolchain.
Test CI report requires nextest package.
We also use udeps clippy and rustfmt on nightly.

There should a possibility to cache the entire ~/.cargo directory to avoid recompilation each time.
For now, I use sccache to cache some crates.

@trustwallet trustwallet deleted a comment from codecov-commenter Mar 29, 2023
@Milerius Milerius changed the title [Rust] Setup CI steps [Rust]: Setup CI steps Mar 29, 2023
@satoshiotomakan
Copy link
Collaborator Author

Test coverage requires cargo-llvm-cov package (therefore llvm-tools-preview rustup tool) and nightly toolchain.
Test CI report requires nextest package.
We also use udeps clippy and rustfmt on nightly.

It takes about 12 minutes to install all of the packages and tools, so I decided to cache the entire ~/./cargo directory after the tools/install-rust-dependencies script.

@satoshiotomakan satoshiotomakan marked this pull request as ready for review March 30, 2023 10:18
@satoshiotomakan satoshiotomakan marked this pull request as draft March 30, 2023 10:30
@satoshiotomakan satoshiotomakan marked this pull request as ready for review March 30, 2023 13:48
@satoshiotomakan satoshiotomakan marked this pull request as draft March 30, 2023 13:54
@satoshiotomakan satoshiotomakan marked this pull request as ready for review March 30, 2023 14:37
@satoshiotomakan
Copy link
Collaborator Author

@Milerius @hewigovens could you please take a look at this PR?

Copy link
Collaborator

@Milerius Milerius left a comment

Choose a reason for hiding this comment

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

Non-blocker comments, approved - I'm ok to have a separate CI for Rust, will facilitate the transition.

rust/coverage.stats Show resolved Hide resolved
tools/rust-lint Show resolved Hide resolved
@Milerius Milerius merged commit 1a214be into master Mar 31, 2023
@Milerius Milerius deleted the rust-ci branch March 31, 2023 09:37
@hewigovens
Copy link
Contributor

Looks good to me, can we cache for other pipelines as well?

@satoshiotomakan
Copy link
Collaborator Author

I haven't checked if the sccache may improve the performance significantly for other pipelines.
I would like to check it as a part of this suggestion #3044

Looks good to me, can we cache for other pipelines as well?

DeanDonkov pushed a commit to changex-app/wallet-core that referenced this pull request Apr 7, 2023
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