From 64af4e2742bc1663441b38e23601d7c070fed803 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 9 Aug 2023 12:42:03 +0200 Subject: [PATCH] Added more debugging to find cause of skipped canary tests refs https://github.com/TryGhost/DevOps/issues/57 - adds a step to output the `needs` context - adds `cancelled` as a "failed" step because it means we haven't run all the tests - unfortunately there's no way to assert all elements are one type (success), so we have to check for existence of the negative ones --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e366859284..9ee476dce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -765,10 +765,13 @@ jobs: if: always() runs-on: ubuntu-latest steps: - - name: Check for failures - if: contains(needs.*.result, 'failure') + - name: Output needs + run: echo "${{ toJson(needs) }}" + + - name: Check if any required jobs failed or been cancelled + if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') run: | - echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1 + echo "One of the dependent jobs have failed or been cancelled. You may need to re-run it." && exit 1 canary: needs: [ @@ -777,7 +780,7 @@ jobs: ] name: Canary runs-on: ubuntu-latest - if: always() && needs.job_get_metadata.outputs.is_canary_branch == 'true' && !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped')) + if: always() && needs.job_get_metadata.outputs.is_canary_branch == 'true' && !(contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped')) steps: - name: Set env variables run: |