From f141b8e66a0310375b7b9ae6bb6396d8dcfcdf65 Mon Sep 17 00:00:00 2001 From: John Murret Date: Tue, 25 Apr 2023 14:25:24 -0600 Subject: [PATCH] ci:backport of success job being skipped --- .github/workflows/build-artifacts.yml | 13 ++++++++----- .github/workflows/build-distros.yml | 13 ++++++++----- .github/workflows/frontend.yml | 13 ++++++++----- .github/workflows/go-tests.yml | 13 ++++++++----- .github/workflows/test-integrations.yml | 13 ++++++++----- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 632950b01d13..2e87d767f5e4 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -123,9 +123,12 @@ jobs: - setup - dev-build-push runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - if: | - (always() && ! cancelled()) && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + if: ${{ always() }} steps: - - run: echo "build-artifacts succeeded" + - name: evaluate upstream job results + run: | + # exit 1 if failure or cancelled result for any upstream job + if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then + printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}" + exit 1 + fi diff --git a/.github/workflows/build-distros.yml b/.github/workflows/build-distros.yml index a423030be5bf..6f5722a82ab9 100644 --- a/.github/workflows/build-distros.yml +++ b/.github/workflows/build-distros.yml @@ -138,9 +138,12 @@ jobs: - build-amd64 - build-arm runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - if: | - (always() && ! cancelled()) && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + if: ${{ always() }} steps: - - run: echo "build-distros succeeded" + - name: evaluate upstream job results + run: | + # exit 1 if failure or cancelled result for any upstream job + if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then + printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}" + exit 1 + fi diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index bcce35da60d6..5eab231c65a5 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -133,9 +133,12 @@ jobs: - node-tests - ember-build-test runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - if: | - (always() && ! cancelled()) && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + if: ${{ always() }} steps: - - run: echo "frontend succeeded" + - name: evaluate upstream job results + run: | + # exit 1 if failure or cancelled result for any upstream job + if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then + printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}" + exit 1 + fi diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 4d8f7b04bc42..e4041c3b50a5 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -407,9 +407,12 @@ jobs: - go-test-sdk-1-20 - go-test-32bit runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - if: | - (always() && ! cancelled()) && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + if: ${{ always() }} steps: - - run: echo "go-tests succeeded" + - name: evaluate upstream job results + run: | + # exit 1 if failure or cancelled result for any upstream job + if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then + printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}" + exit 1 + fi diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 160bb2b9d8ca..10090cfa3e4c 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -493,9 +493,12 @@ jobs: - generate-upgrade-job-matrices - upgrade-integration-test runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - if: | - (always() && ! cancelled()) && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + if: ${{ always() }} steps: - - run: echo "test-integrations succeeded" + - name: evaluate upstream job results + run: | + # exit 1 if failure or cancelled result for any upstream job + if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then + printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}" + exit 1 + fi