Merge pull request 'Replaces unsupported failure()/cancelled() with explicit needs.<job>.result checks in publish gates' (#7) from feature/gitea-workflow-optimizations into master
Continuous Integration / config (push) Successful in 12s
Continuous Integration / changes (push) Successful in 20s
Continuous Integration / backend-build (push) Successful in 4m55s
Continuous Integration / vulnerability-scan (push) Successful in 4m48s
Continuous Integration / frontend-prepare (push) Successful in 1m56s
Continuous Integration / backend-test (push) Successful in 5m37s
Continuous Integration / config (pull_request) Successful in 11s
Continuous Integration / changes (pull_request) Successful in 21s
Continuous Integration / backend-build (pull_request) Skipped
Continuous Integration / backend-test (pull_request) Skipped
Continuous Integration / vulnerability-scan (pull_request) Skipped
Continuous Integration / frontend-prepare (pull_request) Skipped
Continuous Integration / frontend-build (pull_request) Skipped
Continuous Integration / frontend-test (pull_request) Skipped
Continuous Integration / frontend-lint (pull_request) Skipped
Continuous Integration / publish-test (pull_request) Skipped
Continuous Integration / publish-production (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / frontend-build (push) Successful in 2m18s
Continuous Integration / frontend-test (push) Failing after 45s
Continuous Integration / frontend-lint (push) Successful in 1m56s
Continuous Integration / publish-test (push) Skipped
Continuous Integration / publish-production (push) Skipped
Continuous Integration / deploy-test (push) Skipped
Continuous Integration / deploy-production (push) Skipped

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-07-31 21:20:00 +02:00
+35 -8
View File
@@ -53,6 +53,13 @@ jobs:
health_check_url_test: ${{ steps.set.outputs.health_check_url_test }} health_check_url_test: ${{ steps.set.outputs.health_check_url_test }}
health_check_url_production: ${{ steps.set.outputs.health_check_url_production }} health_check_url_production: ${{ steps.set.outputs.health_check_url_production }}
steps: steps:
# Gitea has no reliable way to see a past run's workflow_dispatch input values from the UI, so
# this logs them explicitly — the only durable record of what was actually checked for a run.
- name: Log dispatch inputs
if: github.event_name == 'workflow_dispatch'
run: |
echo "Deploy to Test: ${{ github.event.inputs.deploy_test }}"
echo "Deploy to Production: ${{ github.event.inputs.deploy_production }}"
- id: set - id: set
run: | run: |
echo "artifact_name_test=${{ env.ARTIFACT_NAME_TEST }}" >> "$GITHUB_OUTPUT" echo "artifact_name_test=${{ env.ARTIFACT_NAME_TEST }}" >> "$GITHUB_OUTPUT"
@@ -280,13 +287,25 @@ jobs:
publish-test: publish-test:
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint] needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
# always() bypasses the automatic skip-cascade from a gate job that was itself skipped (because # always() bypasses the automatic skip-cascade from a gate job that was itself skipped (because
# its side of the repo didn't change) — !failure() && !cancelled() still blocks a run where a # its side of the repo didn't change). Gitea Actions only implements always() from the GitHub
# gate that DID run actually failed. The remaining changes.outputs check makes sure there's # Actions status-check functions — success()/failure()/cancelled() are not supported — so each
# something to publish at all: a run that touched neither backend nor frontend has nothing new # gate's outcome is checked explicitly via needs.<job>.result instead: a skipped gate is fine,
# to deploy. # but a gate that actually ran and failed or was cancelled still blocks the publish. The
# changes.outputs check makes sure there's something to publish at all: a run that touched
# neither backend nor frontend has nothing new to deploy. The final line skips this build on a
# manual workflow_dispatch run that didn't check deploy_test — building and uploading a test
# artifact nobody is going to deploy is wasted work; push/PR runs are unaffected.
if: | if: |
always() && !failure() && !cancelled() && always() &&
(needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true') needs.changes.result == 'success' &&
needs.backend-build.result != 'failure' && needs.backend-build.result != 'cancelled' &&
needs.backend-test.result != 'failure' && needs.backend-test.result != 'cancelled' &&
needs.vulnerability-scan.result != 'failure' && needs.vulnerability-scan.result != 'cancelled' &&
needs.frontend-build.result != 'failure' && needs.frontend-build.result != 'cancelled' &&
needs.frontend-test.result != 'failure' && needs.frontend-test.result != 'cancelled' &&
needs.frontend-lint.result != 'failure' && needs.frontend-lint.result != 'cancelled' &&
(needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true') &&
(github.event_name != 'workflow_dispatch' || github.event.inputs.deploy_test == 'true')
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -349,9 +368,17 @@ jobs:
# Vite build-time value: one dist/ bundle cannot be tagged as both 'test' and 'production' (FR-05). # Vite build-time value: one dist/ bundle cannot be tagged as both 'test' and 'production' (FR-05).
publish-production: publish-production:
needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint] needs: [changes, backend-build, backend-test, vulnerability-scan, frontend-build, frontend-test, frontend-lint]
# See publish-test's comment on the always()/!failure()/!cancelled() combination above. # See publish-test's comment above on why this checks needs.<job>.result explicitly instead of
# failure()/cancelled(), which Gitea Actions doesn't support.
if: | if: |
always() && !failure() && !cancelled() && always() &&
needs.changes.result == 'success' &&
needs.backend-build.result != 'failure' && needs.backend-build.result != 'cancelled' &&
needs.backend-test.result != 'failure' && needs.backend-test.result != 'cancelled' &&
needs.vulnerability-scan.result != 'failure' && needs.vulnerability-scan.result != 'cancelled' &&
needs.frontend-build.result != 'failure' && needs.frontend-build.result != 'cancelled' &&
needs.frontend-test.result != 'failure' && needs.frontend-test.result != 'cancelled' &&
needs.frontend-lint.result != 'failure' && needs.frontend-lint.result != 'cancelled' &&
github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_production == 'true' && github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_production == 'true' &&
(needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true') (needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true')
runs-on: ubuntu-latest runs-on: ubuntu-latest