From 502d3c1f9d1a15660818324c400b1a0fbb36e6a6 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 23 May 2026 03:09:18 +0200 Subject: [PATCH] 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 Co-authored-by: Claude (Opus 4.7) --- .github/actions/free-disk-space/action.yml | 9 +++++++++ .github/actions/go-setup/action.yml | 1 + .github/workflows/files-changed.yml | 6 +++++- .github/workflows/pull-db-tests.yml | 10 +++++----- 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 .github/actions/free-disk-space/action.yml diff --git a/.github/actions/free-disk-space/action.yml b/.github/actions/free-disk-space/action.yml new file mode 100644 index 0000000000..510b643a33 --- /dev/null +++ b/.github/actions/free-disk-space/action.yml @@ -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 diff --git a/.github/actions/go-setup/action.yml b/.github/actions/go-setup/action.yml index d6f88bbc6d..a99ef0629a 100644 --- a/.github/actions/go-setup/action.yml +++ b/.github/actions/go-setup/action.yml @@ -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 diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index a7b116fec7..c17afbca97 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -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/**" diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 1a3ce40035..dd2c11a40b 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -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: