I have a workspace project with multiple crates in it. If I run cargo test --workspace
twice in a row locally, it will only compile the crates the first time. But if I push a build to CI, and then push another build with just a dummy change to the README, it will rebuild the crates.
I'm using the following github actions ci config, i.e. it's doing caching:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Leafwing-Studios/cargo-cache@v1
- name: Run tests
run: cargo test --workspace --release
I'm guessing that cargo build
checks the timestamp of the files in the src
directories, and since it's git cloning them out each time they're always "new", but I'm not sure if that's the case.