]> Untitled Git - bdk/commitdiff
Replace current caching solution with Rust Cache
authorVladimir Fomene <vladimirfomene@gmail.com>
Wed, 8 Mar 2023 10:49:54 +0000 (13:49 +0300)
committerDaniela Brozzoni <danielabrozzoni@protonmail.com>
Wed, 8 Mar 2023 14:42:45 +0000 (15:42 +0100)
.github/workflows/code_coverage.yml
.github/workflows/cont_integration.yml
.github/workflows/nightly_docs.yml

index ef68829bd59651cb4f39000d458b844ded0c8dd2..37a7cc46b2b2d325141f0b7f3624b5027ca9b953 100644 (file)
@@ -23,15 +23,8 @@ jobs:
             override: true
             profile: minimal
             components: llvm-tools-preview
-      - name: Cache cargo
-        uses: actions/cache@v3
-        with:
-          path: |
-            ~/.cargo/bin/
-            ~/.cargo/registry/index/
-            ~/.cargo/registry/cache/
-            ~/.cargo/git/db/
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+      - name: Rust Cache
+        uses: Swatinem/rust-cache@v2.2.1
       - name: Install grcov
         run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
       - name: Build simulator image
index 4ce2ad47bc6bfd078c6a897592cdf9a093812d84..a90d74667d477c5642e745bb9540c6496dbbaf95 100644 (file)
@@ -22,14 +22,6 @@ jobs:
         uses: actions/checkout@v2
       - name: Generate cache key
         run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
-      - name: cache
-        uses: actions/cache@v2
-        with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
       - name: Install Rust toolchain
         uses: actions-rs/toolchain@v1
         with:
@@ -37,6 +29,8 @@ jobs:
             override: true
             components: clippy
             profile: minimal
+      - name: Rust Cache
+        uses: Swatinem/rust-cache@v2.2.1
       - name: Build
         run: cargo build ${{ matrix.features }}
       - name: Clippy
@@ -54,14 +48,6 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
-      - name: Cache
-        uses: actions/cache@v2
-        with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
         # Install a recent version of clang that supports wasm32
       - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
       - run: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" || exit 1
@@ -74,6 +60,8 @@ jobs:
             override: true
             profile: minimal
             target: "wasm32-unknown-unknown"
+      - name: Rust Cache
+        uses: Swatinem/rust-cache@v2.2.1
       - name: Check bdk
         working-directory: ./crates/bdk
         run: cargo check --target wasm32-unknown-unknown --features dev-getrandom-wasm
index a4a837c7a91e052e624cb7ecdd6a6b28667b85b8..0321cc533787c43df3d59d4ea032b4d2b070eca6 100644 (file)
@@ -9,20 +9,14 @@ jobs:
     steps:
       - name: Checkout sources
         uses: actions/checkout@v2
-      - name: Setup cache
-        uses: actions/cache@v2
-        with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: nightly-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
       - name: Set default toolchain
         run: rustup default nightly-2022-12-14
       - name: Set profile
         run: rustup set profile minimal
       - name: Update toolchain
         run: rustup update
+      - name: Rust Cache
+        uses: Swatinem/rust-cache@v2.2.1
       - name: Build docs
         run: cargo doc --no-deps
         env: