From ab9242d10ddaaafae3f6433966658af882d1f735 Mon Sep 17 00:00:00 2001 From: Vladimir Fomene Date: Wed, 8 Mar 2023 13:49:54 +0300 Subject: [PATCH] Replace current caching solution with Rust Cache --- .github/workflows/code_coverage.yml | 11 ++--------- .github/workflows/cont_integration.yml | 20 ++++---------------- .github/workflows/nightly_docs.yml | 10 ++-------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index ef68829bd..37a7cc46b 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -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 diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 4ce2ad47b..a90d74667 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -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 diff --git a/.github/workflows/nightly_docs.yml b/.github/workflows/nightly_docs.yml index a4a837c7a..0321cc533 100644 --- a/.github/workflows/nightly_docs.yml +++ b/.github/workflows/nightly_docs.yml @@ -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: