mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-28 18:56:23 +02:00
- e2e and checks-backend: enable build-cache restore so they hit the seeded gobuild cache. - pgsql/sqlite/mysql/mssql: replace `make backend` with `make generate-go`. Integration tests build their own test binary and never invoke the gitea executable; only bindata generation is needed. - unit-tests-gogit: narrow to packages with gogit/nogogit-tagged files via a new `test-backend-gogit` Makefile target. Other packages produce identical compiled output regardless of the gogit tag, so retesting them was busywork. - cache-seeder: stop the lint job from competing with the gobuild job on the shared non-rotated gobuild key. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
74 lines
2.4 KiB
YAML
74 lines
2.4 KiB
YAML
# Populates the go module, build, and golangci-lint caches under the default
|
|
# branch's cache scope so that PR runs have a warm fallback to restore from.
|
|
#
|
|
# GitHub Actions caches are scoped per ref: a PR run can only write to its own
|
|
# branch's scope, but can read from the base branch's scope as a fallback.
|
|
# PRs therefore cannot seed main's scope themselves. Running the same cache
|
|
# steps on push-to-main is the only opportunity to populate that fallback
|
|
# scope so fresh PR branches start with a useful cache on first run.
|
|
|
|
# A PR job's exact key lives in its own PR-scope (empty on first run, filled
|
|
# by later runs of the same PR); on miss, actions/cache's restore-keys fall
|
|
# back to prefix matches against entries this seeder saves in main's scope.
|
|
|
|
name: cache-seeder
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "go.sum"
|
|
- ".golangci.yml"
|
|
- ".github/actions/go-cache/action.yml"
|
|
- ".github/workflows/cache-seeder.yml"
|
|
|
|
concurrency:
|
|
group: cache-seeder
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
gobuild:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version-file: go.mod
|
|
check-latest: true
|
|
cache: false
|
|
- uses: ./.github/actions/go-cache
|
|
with:
|
|
cache-name: seed
|
|
- run: make deps-backend
|
|
- run: TAGS="bindata" make backend
|
|
- run: TAGS="bindata gogit" GOEXPERIMENT="" make backend
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { job: lint-backend, tags: "bindata", target: "lint-backend" }
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version-file: go.mod
|
|
check-latest: true
|
|
cache: false
|
|
- uses: ./.github/actions/go-cache
|
|
with:
|
|
cache-name: ${{ matrix.job }}
|
|
# the gobuild job already saves the shared gobuild cache key; let only it win.
|
|
build-cache: "false"
|
|
lint-cache: "true"
|
|
- run: make deps-backend deps-tools
|
|
- run: make ${{ matrix.target }}
|
|
env:
|
|
TAGS: ${{ matrix.tags }}
|