From 322ba656565ece2eff0b41e1c4fd28d567745d82 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 18 Mar 2023 10:27:34 +0100 Subject: [PATCH] Add Caches --- .github/workflows/master-build.yml | 23 +++++++++++++++++++++-- .github/workflows/release-build.yml | 10 ++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml index c7d987c..7db1fe0 100644 --- a/.github/workflows/master-build.yml +++ b/.github/workflows/master-build.yml @@ -16,16 +16,35 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Cache Cargo modules + id: cache-cargo + uses: actions/cache@v3 + env: + cache-name: cache-cargo-target-debug + with: + path: target + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}- - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose -p schemsearch-lib + build-release: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 + - name: Cache Cargo modules + id: cache-cargo + uses: actions/cache@v3 + env: + cache-name: cache-cargo-target-release + with: + path: target + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}- - name: Build run: cargo build --verbose --release -p schemsearch-cli - name: Upload a Build Artifact diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 5aed70d..0a48337 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,6 +19,16 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Cache Cargo modules + id: cache-cargo + uses: actions/cache@v3 + env: + cache-name: cache-cargo-target-release + with: + path: target + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.cache-name }}- - name: Build run: cargo build --verbose --release -p schemsearch-cli - name: Create Tarball