mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-25 01:34:57 +02:00
ci: tweak files-changed, add free-disk-space (#37819)
Reduces CI minutes consumption by narrowing the `files-changed` filters. - DB matrix (`pgsql`/`mysql`/`mssql`/`unit`) now runs only on real backend changes. `test-sqlite` stays gated on `actions`, so it remains the smoke check that validates CI-infra changes (composite-action edits, workflow edits, renovate action-pin bumps) without spinning up the full matrix. - Fix the `templates` filter: the SVG template linter is `tools/lint-templates-svg.ts`, so the `tools/lint-templates-*.js` glob matched nothing. - Add missed paths: `tsconfig.json` and `tools/generate-svg-vscode-extensions.json` to `frontend`, `eslint.json.config.ts` to `json`, and `.github/actions/docker-dryrun/**` to `docker`. --- This PR was written with the help of Claude Opus 4.7 --------- Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
parent
a290d81eab
commit
502d3c1f9d
9
.github/actions/free-disk-space/action.yml
vendored
Normal file
9
.github/actions/free-disk-space/action.yml
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
name: free-disk-space
|
||||
description: Free space on / before large cache restores
|
||||
|
||||
# Delete preinstalled toolchains which gitea doesn't use
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: bash
|
||||
run: sudo rm -rf /usr/local/lib/android /usr/local/.ghcup /opt/ghc /usr/share/dotnet
|
||||
1
.github/actions/go-setup/action.yml
vendored
1
.github/actions/go-setup/action.yml
vendored
@ -12,6 +12,7 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: ./.github/actions/free-disk-space
|
||||
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
6
.github/workflows/files-changed.yml
vendored
6
.github/workflows/files-changed.yml
vendored
@ -69,6 +69,8 @@ jobs:
|
||||
- "*.ts"
|
||||
- "web_src/**"
|
||||
- "tools/generate-svg.ts"
|
||||
- "tools/generate-svg-vscode-extensions.json"
|
||||
- "tsconfig.json"
|
||||
- "assets/emoji.json"
|
||||
- "package.json"
|
||||
- "pnpm-lock.yaml"
|
||||
@ -88,13 +90,14 @@ jobs:
|
||||
- "Makefile"
|
||||
|
||||
templates:
|
||||
- "tools/lint-templates-*.js"
|
||||
- "tools/lint-templates-*.ts"
|
||||
- "templates/**/*.tmpl"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
|
||||
docker:
|
||||
- ".github/workflows/pull-docker-dryrun.yml"
|
||||
- ".github/actions/docker-dryrun/**"
|
||||
- "Dockerfile"
|
||||
- "Dockerfile.rootless"
|
||||
- "docker/**"
|
||||
@ -122,6 +125,7 @@ jobs:
|
||||
json:
|
||||
- "**/*.json"
|
||||
- "**/*.json5"
|
||||
- "eslint.json.config.ts"
|
||||
|
||||
e2e:
|
||||
- "tests/e2e/**"
|
||||
|
||||
10
.github/workflows/pull-db-tests.yml
vendored
10
.github/workflows/pull-db-tests.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
uses: ./.github/workflows/files-changed.yml
|
||||
|
||||
test-pgsql-shard-1:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 50
|
||||
@ -51,7 +51,7 @@ jobs:
|
||||
run-migration: "true"
|
||||
|
||||
test-pgsql-shard-2:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 50
|
||||
@ -110,7 +110,7 @@ jobs:
|
||||
GOEXPERIMENT:
|
||||
|
||||
test-unit:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
@ -174,7 +174,7 @@ jobs:
|
||||
- run: make test-check
|
||||
|
||||
test-mysql:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
@ -220,7 +220,7 @@ jobs:
|
||||
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
|
||||
|
||||
test-mssql:
|
||||
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
|
||||
if: needs.files-changed.outputs.backend == 'true'
|
||||
needs: files-changed
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user