GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

Speedup ci #1556

Closed NobodyXu closed 1 month ago

NobodyXu commented 1 month ago
NobodyXu commented 1 month ago

@Byron it shows that this PR makes ci.yml 5m faster

NobodyXu commented 1 month ago

I am also surprised that cargo nextest manages to do the same faster, but maybe it's just the removal of clear-target

It could be caching, but nextest is indeed faster if you have lots of tests and more than 1 cores, I checked the log it does run tests for some crates faster by running them in parallel by spawning one process for each tests.

It might be more robust if your tests involve global variables or potential UBs, running in separate processes protects against that.

NobodyXu commented 1 month ago

wasn't aware it can be used as cargo test stand-in - it's very neat, indeed!

It's not a full drop-in, it can't run doc-test right now, you'd need cargo test --doc.

However I think you don't have the habit of using doc-test so often as most of the valuable tests is probably in tests/ or under #[cfg(test)] mod tests

NobodyXu commented 1 month ago

P.S. nextest also integrates with llvm-cov, miri, criterion and cargo-mutants

https://nexte.st/docs/integrations/

NobodyXu commented 1 month ago

https://github.com/nextest-rs/reuse-build-partition-example/blob/main/.github/workflows/ci.yml

And it can:

Byron commented 1 month ago

Thanks again for the heads-up! cargo nextest is truly fascinating, and I hope that one day it will also learn how to run doc tests (even though it now also improves to be more efficient when compiling and running these tests).