The rust compiler rustc and cargo do the heavy lifting to make sure my code compile independently of the os/architecture.
However, is it necessary to run each version/commands on each OS ([linux, osx, windows]) and/or architectures (amd64/arm64) ?
For example, suppose I didn't write a piece of code hardly dependent to specific OS features or architecture.
If my cargo build and cargo test steps passed on linux/amd64 should I build on other platforms or can I trust the rust compiler to work everywhere?
Are cargo clippy and cargo fmt architecture/OS dependent ? If checks passed on linux/amd64 can I be confident clippy/rustfmt won't throw errors/warning on other platforms ?
Thanks for reading
EDIT: The main goal is to not overstay on CI runners if running the specified commands will not raise any errors if they passed on one architecture/OS already.
A dependency of yours may depend on a specific OS, or work slightly different on different OSes.
cargo fmt is should return the same result on all systems I think. cargo clippy may return different results on different systems, but unless you are writing platform dependent code yourself, this will be unlikely.
You should probably run cargo build and cargo test on all systems, and cargo fmt and cargo clippy just on one system.
This command checks all my code (main, lib, unit-test, integration-test, doc-tests) but do it recursively on all dependency.
If I drop arguments --all-targets --all-features clippy just check my main/lib.
Is it possible to check all my code including unit-test/integration-test and excluding dependencies ?