Skip to content

Commit

Permalink
Merge pull request #2020 from Sefaria/chore/sc-29090/fail-github-cont…
Browse files Browse the repository at this point in the history
…inuous-workflow-if-image

      Try to get Continuous Pytests to explicitly fail if any previous steps failed
  • Loading branch information
edamboritz authored Sep 12, 2024
2 parents d6151ea + 057a0e5 commit 0d7df06
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/continuous.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Continuous
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
merge_group:
push:
branches:
Expand Down Expand Up @@ -178,9 +183,9 @@ jobs:
concurrency:
group: dev-mongo
cancel-in-progress: false
needs: [ build-derived ]
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: build-derived
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -251,9 +256,8 @@ jobs:
concurrency:
group: dev-mongo
cancel-in-progress: false
needs: [ sandbox-ready ]
if: github.event.pull_request.draft == false
needs:
- sandbox-ready
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -371,3 +375,26 @@ jobs:
- name: Uninstall
run: helm delete sandbox-${{ steps.get-sha.outputs.sha_short }} -n ${{ secrets.DEV_SANDBOX_NAMESPACE }} --debug --timeout 10m0s
if: steps.get-helm.outputs.count > 0
continuous-branch-protection:
needs: [ build-generic, build-derived, sandbox-deploy, sandbox-ready, pytest-job ]
runs-on: ubuntu-latest
if: always()
steps:
- name:
run: |
if [ "${{ github.event_name }}" == "merge_group" ]; then
exit 0
fi
if [ "${{ needs.build-generic.result }}" != "success" ] || \
[ "${{ needs.build-derived.result }}" != "success" ]; then
echo "One or more build jobs failed"
exit 1
fi
if [ "${{ github.event.pull_request.draft }}" == "false" ]; then
if [ "${{ needs.sandbox-deploy.result }}" != "success" ] || \
[ "${{ needs.sandbox-ready.result }}" != "success" ] || \
[ "${{ needs.pytest-job.result }}" != "success" ]; then
echo "One or more test jobs failed"
exit 1
fi
fi

0 comments on commit 0d7df06

Please sign in to comment.