From 8db0b14c160706817c05ebd1cefb1cb88f13e5fd Mon Sep 17 00:00:00 2001 From: Fergus Molloy Date: Fri, 18 Jul 2025 13:48:36 +0100 Subject: [PATCH] use go hash --- .gitea/workflows/cargo.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/cargo.yaml b/.gitea/workflows/cargo.yaml index 99480e3..944f7c2 100644 --- a/.gitea/workflows/cargo.yaml +++ b/.gitea/workflows/cargo.yaml @@ -10,15 +10,27 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + - uses: actions/setup-go@v3 + with: + go-version: '1.20' + + - uses: actions/go-hashfiles@v0.0.1 + id: get-hash + with: + patterns: |- + **/Cargo.toml + + - name: Echo hash + run: echo ${{ steps.get-hash.outputs.hash }} - name: Cargo target cache uses: actions/cache@v4 with: path: | ~/.cargo target - key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-target-${{ setps.get-hash.outputs.hash }}-${{ setps.get-hash.outputs.hash }} restore-keys: | - ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }} + ${{ runner.os }}-cargo-target-${{ setps.get-hash.outputs.hash }} ${{ runner.os }}-cargo-target - name: Build project uses: actions-rs/cargo@v1