0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

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
This commit is contained in:
Daniel Lockyer 2023-08-09 12:42:03 +02:00 committed by Daniel Lockyer
parent b4bf0bcf54
commit 64af4e2742

View file

@ -765,10 +765,13 @@ jobs:
if: always() if: always()
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check for failures - name: Output needs
if: contains(needs.*.result, 'failure') run: echo "${{ toJson(needs) }}"
- name: Check if any required jobs failed or been cancelled
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: | 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: canary:
needs: [ needs: [
@ -777,7 +780,7 @@ jobs:
] ]
name: Canary name: Canary
runs-on: ubuntu-latest 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: steps:
- name: Set env variables - name: Set env variables
run: | run: |