diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 257f2ab995..f2bfc417a8 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -1,6 +1,11 @@ name: Continuous on: pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review merge_group: push: branches: @@ -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' @@ -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' @@ -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