Skip to content

Commit

Permalink
fix: amend trigger for api tests failure as github wasn't honouring t…
Browse files Browse the repository at this point in the history
…he failure condition
  • Loading branch information
johnrwatson committed Dec 12, 2024
1 parent 44dc9cc commit 13e8811
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
runs-on: ubuntu-latest
needs: cypress-tests
environment: ${{ inputs.environment }}
if: ${{ failure() && github.ref == 'refs/heads/main' }}
if: failure()
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
Expand All @@ -145,7 +145,7 @@ jobs:
fi
done
# If at least one valid failure marker is present, then page
if [ "$has_artifacts" = true ]; then
if [ "$has_artifacts" = true ] && [ "${{ github.ref_name }}" = "main" ]; then
curl --location "${{ secrets.FIREHYDRANT_WEBHOOK_URL }}" \
--header "Content-Type: application/json" \
--data "{
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/run-api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ jobs:
exit "$exit_code"
- name: Upload artifact if exit code 53
if: ${{ failure() && env.last_exit_code == '53' }}
if: failure()
run: |
echo "Uploading marker for test ${{ matrix.tests.name }}"
mkdir -p artifacts/${{ matrix.tests.name }}
echo "failure-marker" > artifacts/${{ matrix.tests.name }}/failure-marker
if [ "${{ env.last_exit_code }}" == "53" ]; then
echo "Uploading marker for test ${{ matrix.tests.name }}"
mkdir -p artifacts/${{ matrix.tests.name }}
echo "failure-marker" > artifacts/${{ matrix.tests.name }}/failure-marker
fi
- name: Upload artifacts
if: ${{ failure() && env.last_exit_code == '53' }}
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tests.name }}
Expand All @@ -145,7 +147,7 @@ jobs:
runs-on: ubuntu-latest
needs: api-test
environment: ${{ inputs.environment }}
if: ${{ failure() && github.ref == 'refs/heads/main' }}
if: failure()
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
Expand All @@ -163,7 +165,7 @@ jobs:
fi
done
# If at least one valid failure marker is present, then page
if [ "$has_artifacts" = true ]; then
if [ "$has_artifacts" = true ] && [ "${{ github.ref_name }}" = "main" ]; then
curl --location "${{ secrets.FIREHYDRANT_WEBHOOK_URL }}" \
--header "Content-Type: application/json" \
--data "{
Expand Down

0 comments on commit 13e8811

Please sign in to comment.