From 38dab1df02dc50c8ff4afed7098724739b363b90 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sun, 21 May 2023 23:19:39 +0800 Subject: [PATCH] ci: cache dependencies. --- .gitea/workflows/built-bin.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/built-bin.yaml b/.gitea/workflows/built-bin.yaml index 47ed677..c66b973 100644 --- a/.gitea/workflows/built-bin.yaml +++ b/.gitea/workflows/built-bin.yaml @@ -5,6 +5,15 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Get Dependencies Index Hash + uses: actions/go-hashfiles@v0.0.1 + id: hash-dependencies-index + with: + patterns: '**/Cargo.lock' + - name: Restore Dependencies id: restore-dependencies uses: https://github.com/actions/cache@v3 @@ -15,10 +24,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('~/Cargo.lock') }} - - - name: Check out repository code - uses: actions/checkout@v3 + key: ${{ runner.os }}-cargo-${{ steps.hash-dependencies-index.outputs.hash }} - name: Install Rust uses: https://github.com/actions-rs/toolchain@v1 @@ -89,4 +95,3 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} -