mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-23 05:42:33 +09:00
1. Split the psql matrix jobs into composite actions. Matrix jobs that can skip do not work with required checks on GitHub because skipped and unskipped emit different job names (GitHub bug https://github.com/orgs/community/discussions/9141). 2. Dedupe node and go setup steps into composite actions Currently test-psql branch protection is disabled, will re-enable when merging this. --------- Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: Nicolas <bircni@icloud.com>
73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
# Populates main's cache scope so PR runs warm-start from it. Saves the go
|
|
# module, go build (incl. test compile), and golangci-lint caches.
|
|
#
|
|
# Caches are ref-scoped: PR runs read their own scope then fall back to the
|
|
# base branch. Per .github/actions/go-cache/action.yml, PRs are restore-only,
|
|
# so push-to-main is the only opportunity to populate the fallback scope.
|
|
|
|
name: cache-seeder
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "go.sum"
|
|
- ".golangci.yml"
|
|
- ".github/actions/go-cache/action.yml"
|
|
- ".github/actions/go-setup/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: ./.github/actions/go-setup
|
|
- run: make deps-backend deps-tools
|
|
- run: TAGS="bindata" make backend
|
|
- run: TAGS="bindata gogit" GOEXPERIMENT="" make backend
|
|
- name: warm test compile cache (bindata)
|
|
env:
|
|
TAGS: bindata
|
|
GOTEST_FLAGS: -race -list=^$$ -count=1
|
|
run: make test-backend
|
|
- name: warm test compile cache (bindata gogit)
|
|
env:
|
|
TAGS: bindata gogit
|
|
GOEXPERIMENT:
|
|
GOTEST_FLAGS: -race -list=^$$ -count=1
|
|
run: make test-backend
|
|
- name: warm integration compile cache
|
|
run: |
|
|
TAGS="bindata" make test-integration-compile
|
|
TAGS="bindata gogit" GOEXPERIMENT="" make test-integration-compile
|
|
TAGS="bindata gogit" GOTEST_FLAGS="-race" make test-integration-compile
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { tags: "bindata", target: "lint-backend" }
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: ./.github/actions/go-setup
|
|
with:
|
|
lint-cache: "true"
|
|
- run: make deps-backend deps-tools
|
|
- run: make generate-go
|
|
env:
|
|
TAGS: ${{ matrix.tags }}
|
|
- run: make ${{ matrix.target }}
|
|
env:
|
|
TAGS: ${{ matrix.tags }}
|