From 807b9ff81d5e20cefdf32c377c0640cb994a7dfc Mon Sep 17 00:00:00 2001 From: Jay Ravani Date: Thu, 22 Oct 2026 18:37:46 +0200 Subject: [PATCH] chore: skip integration tests for documentation-only changes The integration job starts PostGIS containers and runs for several minutes, and it ran for every push and pull request, including ones that change only documentation. GitHub filters by changed paths per workflow, not per job, so the job moves unchanged from go.yml to its own integration.yml with paths-ignore for docs/, Markdown files, mkdocs.yml, CITATION.cff, LICENSE, NOTICE, the issue templates and the docs workflow. Any other change, including sql/, data/ and testdata/, still runs it, as does a change mixing docs and code. go.yml's unit build and tests run on every change as before. No ruleset requires a status check, so a skipped run blocks no merge. codecov.yml waits for two coverage uploads; a docs-only commit now sends one, so Codecov posts no status for it. --- .github/workflows/go.yml | 25 -------------- .github/workflows/integration.yml | 57 +++++++++++++++++++++++++++++++ codecov.yml | 7 ++-- 3 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6e79427..db985ab 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -33,28 +33,3 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: unit - - integration: - name: Integration Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: 'go.mod' - - - name: Install psql client - run: sudo apt-get install -y postgresql-client - - - name: Integration Tests - run: go test -tags integration -v -timeout 10m -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./internal/process/ ./internal/db/ ./internal/importer/ ./internal/api/... ./internal/onrequest/... ./internal/environment/... - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: integration diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..447ca00 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,57 @@ +name: Integration + +# paths-ignore applies per workflow, not per job, so the integration job has a +# workflow of its own; go.yml's unit job still runs on every change. +on: + push: + branches: [ "main", "dev" ] + paths-ignore: + - "docs/**" + - "**.md" + - "mkdocs.yml" + - "CITATION.cff" + - "LICENSE" + - "NOTICE" + - ".github/ISSUE_TEMPLATE/**" + - ".github/workflows/docs.yml" + pull_request: + branches: [ "main", "dev" ] + paths-ignore: + - "docs/**" + - "**.md" + - "mkdocs.yml" + - "CITATION.cff" + - "LICENSE" + - "NOTICE" + - ".github/ISSUE_TEMPLATE/**" + - ".github/workflows/docs.yml" + +permissions: + contents: read + +jobs: + + integration: + name: Integration Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + + - name: Install psql client + run: sudo apt-get install -y postgresql-client + + - name: Integration Tests + run: go test -tags integration -v -timeout 10m -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./internal/process/ ./internal/db/ ./internal/importer/ ./internal/api/... ./internal/onrequest/... ./internal/environment/... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: integration diff --git a/codecov.yml b/codecov.yml index 7251817..614d28a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,10 +1,11 @@ -# go.yml uploads coverage twice per commit: the "unit" job runs go test ./... -# (no build tag) and the "integration" job runs go test -tags integration on the +# Coverage is uploaded twice per commit: go.yml's "unit" job runs go test ./... +# (no build tag) and integration.yml runs go test -tags integration on the # DB-dependent packages. Without this, Codecov posts a status as soon as either # upload lands - since the unit job usually finishes first and barely touches # DB-dependent code, PRs would briefly show a failing patch-coverage check that # flips to passing once the integration job's upload arrives a bit later. -# after_n_builds waits for both before posting a final status. +# after_n_builds waits for both before posting a final status. A docs-only +# commit skips integration.yml, so Codecov posts no status for it. codecov: notify: after_n_builds: 2