jonhoo / rust-ci-conf

Collection of CI configuration files for Rust projects
287 stars 60 forks source link

Add action to run doctest. #3

Closed Wasabi375 closed 1 year ago

Wasabi375 commented 1 year ago

cargo test --all-features does not run doc-tests. For more information see https://github.com/rust-lang/cargo/issues/6669.

Btw I wanted to thank you for your amazing streams. I haven't been able to catch any of them live but your youtube videos got me started with rust. And I hope you don't mind me stealling this repo and adding it to my own projects 😉

jonhoo commented 1 year ago

Ah, so, it's actually --all-targets, not --all-features that trigger that issue I believe, but it's a good catch! The way I'd prefer to fix this is instead to just add another step to the existing test job that runs cargo test --all-features --doc, with a comment above it linking to that cargo issue. Would you mind updating the PR to that? Otherwise I can also just commit that myself :)

Wasabi375 commented 1 year ago

Yeah, your totaly right. It's all-targets that does not run doc-tests. Not sure why I always mix those 2 up. I sweare 95% of the time I want to pass one of those as arguments to cargo, I use the wrong one. PR should be updated. Using an additional step is much more elegant anyways. No need to compile everything twice.

jonhoo commented 1 year ago

Excellent! Would you mind also adding a comment just above the step (like there is for the previous step) linking to the Cargo issue about --all-targets for future reference?