sarutak commented on code in PR #2517:
URL: https://github.com/apache/avro/pull/2517#discussion_r1337876820
##########
.github/workflows/test-lang-rust-ci.yml:
##########
@@ -58,20 +58,59 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- - name: Cache Cargo
+ - name: Cache Cargo for 1.65.0
+ if: matrix.rust == '1.65.0' && matrix.target ==
'x86_64-unknown-linux-gnu'
uses: actions/cache@v3
with:
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
path: ~/.cargo
- key: cargo-cache1-
+ key: cargo-cache1-1.65.0-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Cache Cargo for 1.65.0 (Restore Only)
+ if: matrix.rust == '1.65.0' && matrix.target !=
'x86_64-unknown-linux-gnu'
+ uses: actions/cache/restore@v3
Review Comment:
Having only `restore` for some cache is intended.
For `lang/rust/target`, if a target is `wasm32-unknown-unknown`, cargo test
doesn't run. So if `wasm32-unknown-unknown` finishes earlier than
`x86_64-unknown-linux-gnu`, the dependencies built for tests will not be cached
right?
For `~/.cargo`, it might not be necessary to separate by conditions.
But, at least `web-assembly` job should be configured `restore` only.
See
https://github.com/apache/avro/actions/runs/6277247580/job/17048597779#step:7:12
All the jobs download dependencies except for `web-assembly` job.
I guess this means `~/.cargo` of `web-assembly` was cached because
`web-assembly` job finished first but `~/.cargo` of `web-assembly` doesn't
contain all the necessary dependencies for other jobs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]