mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 14:54:28 +00:00
ci: improve go caches (#38730)
Cache saves have been rejected since June because the repo sat above its 10 GB allowance, so every PR run fell back to a cache built with an older toolchain and rebuilt the backend from scratch. - go version in the `gobuild` and `golint` keys and `restore-keys` - seeder triggers on `go.mod` and gained `workflow_dispatch` - single writer for the `gomod` cache, the two were racing - new daily `cache-prune` workflow holding the total under a limit - `cache: false` for `setup-go` in release and cron workflows, it held 815 MB - add `workflow_dispatch` so the cache workflows can be triggered on-demand Assisted-by: Claude Code:claude-opus-5
This commit is contained in:
@@ -8,10 +8,12 @@
|
||||
name: cache-seeder
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "go.mod" # a toolchain bump invalidates the build caches
|
||||
- "go.sum"
|
||||
- ".golangci.yml"
|
||||
- ".github/actions/go-cache/action.yml"
|
||||
@@ -70,3 +72,10 @@ jobs:
|
||||
- run: make ${{ matrix.target }}
|
||||
env:
|
||||
TAGS: ${{ matrix.tags }}
|
||||
|
||||
# reclaims the caches this run superseded, so the next save still fits in the allowance
|
||||
prune:
|
||||
needs: [gobuild, lint]
|
||||
permissions:
|
||||
actions: write
|
||||
uses: ./.github/workflows/cache-prune.yml
|
||||
|
||||
Reference in New Issue
Block a user