You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2023/10/03 12:29:07 UTC

[avro] branch avro-3870-better-cache-keys created (now 16824481e)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch avro-3870-better-cache-keys
in repository https://gitbox.apache.org/repos/asf/avro.git


      at 16824481e AVRO-3870: [Rust] Use matrix.target, matrix.avro and hash of Cargo.lock for cache keys

This branch includes the following new commits:

     new 16824481e AVRO-3870: [Rust] Use matrix.target, matrix.avro and hash of Cargo.lock for cache keys

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[avro] 01/01: AVRO-3870: [Rust] Use matrix.target, matrix.avro and hash of Cargo.lock for cache keys

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch avro-3870-better-cache-keys
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 16824481e7f34771ec2c11b02cb8eb2f51395fc2
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Oct 3 15:28:12 2023 +0300

    AVRO-3870: [Rust] Use matrix.target, matrix.avro and hash of Cargo.lock for cache keys
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 .github/workflows/test-lang-rust-ci.yml | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/test-lang-rust-ci.yml b/.github/workflows/test-lang-rust-ci.yml
index 5993cd590..b3b9a40cb 100644
--- a/.github/workflows/test-lang-rust-ci.yml
+++ b/.github/workflows/test-lang-rust-ci.yml
@@ -31,6 +31,7 @@ permissions:
 
 env:
   RUSTFLAGS: -Dwarnings
+  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: 'git' # TODO: remove this env var once MSRV is 1.70.0+
 
 defaults:
   run:
@@ -64,14 +65,15 @@ jobs:
           # these represent dependencies downloaded by cargo
           # and thus do not depend on the OS, arch nor rust version.
           path: ~/.cargo
-          key: cargo-cache1-
+          key: ${{ runner.os }}-cargo-cache1-${{ matrix.target }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
+
       - name: Cache Rust dependencies
         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
+          key: ${{ runner.os }}-target-cache1-${{ matrix.target }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
 
       - name: Rust Toolchain
         uses: dtolnay/rust-toolchain@nightly
@@ -135,12 +137,13 @@ jobs:
           # and thus do not depend on the OS, arch nor rust version.
           path: ~/.cargo
           key: cargo-cache1-
+
       - name: Cache Rust dependencies
         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
+          path: lang/rust/target
           key: ${{ runner.os }}-target-cache1-stable-
 
       - name: Cache Local Maven Repository
@@ -219,15 +222,15 @@ jobs:
           # these represent dependencies downloaded by cargo
           # and thus do not depend on the OS, arch nor rust version.
           path: ~/.cargo
-          key: cargo-cache1-
+          key: ${{ runner.os }}-cargo-cache1-web-assembly-${{ hashFiles('**/Cargo.lock') }}
 
       - name: Cache Rust dependencies
         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-stable-
+          path: lang/rust/target
+          key: ${{ runner.os }}-target-cache1-stable-web-assembly-${{ hashFiles('**/Cargo.lock') }}
 
       - name: Install wasm-pack
         run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh