[v11.0/forgejo] ci: tie go cache to go version and add Makefile to key hash (#10885)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/10883

- tie go cache to go version, so it will cleanup from time to time [see](https://codeberg.org/forgejo/discussions/issues/436)
- Add `Makefile` to cache key hash, because it also has go deps

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10885
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2026-01-17 22:34:47 +01:00 committed by Gusted
parent 84f236c43d
commit 5972b319b3

View file

@ -52,10 +52,9 @@ runs:
id: cache-deps id: cache-deps
uses: https://data.forgejo.org/actions/cache@v4 uses: https://data.forgejo.org/actions/cache@v4
with: with:
key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod') }} key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod', 'Makefile') }}
restore-keys: | restore-keys: |
setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}- setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-
setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-
path: | path: |
${{ steps.go-environment.outputs.modcache }} ${{ steps.go-environment.outputs.modcache }}
${{ steps.go-environment.outputs.cache }} ${{ steps.go-environment.outputs.cache }}