diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 51c25b52..2d8f7833 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -6,14 +6,13 @@ on: # a branch PRs never target (this said `master`, which does not exist) means # the workflow never runs at all. # - # paths-ignore: a kind+cert-manager+Kamaji provisioning run costs ~30-45 - # minutes; skip it for PRs that touch nothing the suite exercises - # (docs-only changes). Everything else — Go code, manifests, the harness, - # the workflows themselves — still gates. + # No paths filter on the trigger either: `kamaji-datastore` is a *required* + # status check, and a workflow skipped at the trigger never reports its + # check, leaving the required context stuck in "Expected" — which blocks the + # PR forever (e.g. docs-only PRs). Path filtering instead lives in the + # `changes` job below; a job skipped via `if:` still reports its check as + # "skipped", which branch protection treats as passing. pull_request: - paths-ignore: - - '**.md' - - 'docs/**' push: tags: [ "v*" ] workflow_dispatch: @@ -23,7 +22,34 @@ concurrency: cancel-in-progress: true jobs: + changes: + # Cheap (~seconds, no checkout — dorny uses the PR API) gate that decides + # whether the expensive job below needs to run. PR-only: tag pushes and + # manual dispatch always run the suite unconditionally (see the `if` on + # kamaji-datastore). + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + # `code` is true when the PR touches anything the e2e suite + # exercises. Only-negated patterns get an implicit `**`, so this + # reads as "all files except Markdown and docs/**" — i.e. docs-only + # PRs leave `code` false and the ~30-45 min run below is skipped. + filters: | + code: + - '!**/*.md' + - '!docs/**' + kamaji-datastore: + needs: changes + # Always run for tag pushes / manual dispatch; for PRs, run only when + # non-docs files changed. When skipped on a docs-only PR the check still + # reports (as "skipped" = passing), so the PR is not blocked. + if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.code == 'true' }} runs-on: ubuntu-latest timeout-minutes: 45 steps: diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml index b4a057c6..18595b67 100644 --- a/.github/workflows/release-smoke.yml +++ b/.github/workflows/release-smoke.yml @@ -10,17 +10,13 @@ name: Release install smoke # introduces them, not on the first real tag. The image is loaded into kind, # never pushed — no registry credentials. on: + # No paths filter on the trigger: `smoke (helm)` and `smoke (manifest)` are + # *required* status checks, and a workflow skipped at the trigger never + # reports them, leaving the required contexts stuck in "Expected" and + # blocking the PR forever (e.g. docs-only PRs). Path filtering lives in the + # `changes` job below instead; the matrix job is skipped via `if:` when + # nothing release-relevant changed, and a skipped check counts as passing. pull_request: - paths: - - '.github/workflows/release-smoke.yml' - - '.github/workflows/docker-publish.yml' - - '.github/workflows/release-assets.yml' - - '.github/workflows/helm-publish.yml' - - 'hack/release-smoke.sh' - - 'charts/**' - - 'Makefile' - - 'Dockerfile' - - 'api/**' workflow_dispatch: concurrency: @@ -28,7 +24,38 @@ concurrency: cancel-in-progress: true jobs: + changes: + # Cheap (~seconds, no checkout) gate. PR-only: manual dispatch always runs + # the smoke matrix unconditionally (see the `if` on smoke). + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + outputs: + release: ${{ steps.filter.outputs.release }} + steps: + - uses: dorny/paths-filter@v3 + id: filter + with: + # True when the PR touches the tag-release machinery or anything it + # ships. Matches the paths this workflow used to filter on at the + # trigger; PRs that touch none of these skip the two kind smokes. + filters: | + release: + - '.github/workflows/release-smoke.yml' + - '.github/workflows/docker-publish.yml' + - '.github/workflows/release-assets.yml' + - '.github/workflows/helm-publish.yml' + - 'hack/release-smoke.sh' + - 'charts/**' + - 'Makefile' + - 'Dockerfile' + - 'api/**' + smoke: + needs: changes + # Always run on manual dispatch; for PRs, run only when release-relevant + # files changed. When skipped, each matrix leg's required check still + # reports as "skipped" (= passing), so the PR is not blocked. + if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.release == 'true' }} runs-on: ubuntu-latest timeout-minutes: 30 permissions: