martin-g commented on code in PR #2517:
URL: https://github.com/apache/avro/pull/2517#discussion_r1337674862


##########
.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:
   This looks weird. 
   ` actions/cache@v3` does two things - first it restores the cache and later 
in the post-processing saves the cache.
   Now you introduce the new `actions/cache/restore@v3` which gives you more 
control when to `restore` but it should be used with `actions/cache/save@v3` to 
have a better control **when** to `save`.
   
   



##########
.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
+        with:
+          # these represent dependencies downloaded by cargo
+          # and thus do not depend on the OS, arch nor rust version.
+          path: ~/.cargo
+          key: cargo-cache1-1.65.0-${{ hashFiles('**/Cargo.lock') }}
+
+      - name: Cache Cargo for 1.70.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-${{ hashFiles('**/Cargo.lock') }}
+
+      - name: Cache Cargo for 1.70.0+ (Restore Only)
+        if: matrix.rust != '1.65.0' && matrix.target != 
'x86_64-unknown-linux-gnu'
+        uses: actions/cache/restore@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-${{ hashFiles('**/Cargo.lock') }}
+
       - name: Cache Rust dependencies
+        if: matrix.target == 'x86_64-unknown-linux-gnu'
         uses: actions/cache@v3
         with:
           # these represent compiled steps of both dependencies and avro
           # and thus are specific for a particular OS, arch and rust version.
-          path: ~/target
-          key: ${{ runner.os }}-target-cache1-${{ matrix.rust }}-
+          path: lang/rust/target

Review Comment:
   IMO this should be 
   ```suggestion
             path: ./target
   ```
   but it has to be tested!



-- 
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]

Reply via email to