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

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new 911b7af16 AVRO-3870: [Rust][Build] Speed up CI for Rust (#2517)
911b7af16 is described below

commit 911b7af1640fd21532d5f6082273703f6c95656d
Author: Kousuke Saruta <[email protected]>
AuthorDate: Wed Oct 11 05:08:17 2023 +0900

    AVRO-3870: [Rust][Build] Speed up CI for Rust (#2517)
---
 .github/workflows/test-lang-rust-ci.yml | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/test-lang-rust-ci.yml 
b/.github/workflows/test-lang-rust-ci.yml
index b2f7425ba..db82a8532 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,14 @@ 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 }}-target-cache1-${{ 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.rust }}-${{ 
hashFiles('**/Cargo.lock') }}
 
       - name: Rust Toolchain
         uses: dtolnay/rust-toolchain@nightly
@@ -134,14 +135,14 @@ 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 }}-target-cache1-${{ 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-${{ 
hashFiles('**/Cargo.lock') }}
 
       - name: Cache Local Maven Repository
         uses: actions/cache@v3
@@ -219,15 +220,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 }}-target-cache1-${{ 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-${{ 
hashFiles('**/Cargo.lock') }}
 
       - name: Install wasm-pack
         run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf 
| sh

Reply via email to