From 36441a19210e22cf8afe05726d9cdb76d9703de3 Mon Sep 17 00:00:00 2001 From: Fergus Molloy Date: Fri, 18 Jul 2025 12:37:32 +0100 Subject: [PATCH] try go hash --- .gitea/workflows/cargo.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/cargo.yaml b/.gitea/workflows/cargo.yaml index ff1fb9e..6ccc159 100644 --- a/.gitea/workflows/cargo.yaml +++ b/.gitea/workflows/cargo.yaml @@ -8,16 +8,26 @@ jobs: RUNNER_TOOL_CACHE: /toolcache runs-on: rust-latest steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Cargo target cache - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v3 with: + go-version: '1.24' + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + id: get-hash + with: + patterns: Cargo.toml + - name: Echo hash + run: echo ${{ steps.get-hash.outputs.hash }} + - name: cache go + id: cache-go + uses: actions/cache@v3 + with: # Specify with your cache path path: | ~/.cargo/registry - ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: go_path-${{ steps.hash-go.outputs.hash }} + restore-keys: |- + go_cache-${{ steps.hash-go.outputs.hash }} - name: Build project uses: actions-rs/cargo@v1 with: