diff --git a/.github/workflows/pr-deploy-and-test.yml b/.github/workflows/pr-deploy-and-test.yml index 4bfac98a25..aff2032449 100644 --- a/.github/workflows/pr-deploy-and-test.yml +++ b/.github/workflows/pr-deploy-and-test.yml @@ -1,11 +1,37 @@ name: PR Deploy and Test on: - pull_request: - types: [opened, synchronize, reopened] + workflow_run: + workflows: ["Quality Checks"] + types: + - completed jobs: - deploy-pr-backend: + on-start: + name: Workflow startup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 + - name: Running Notification + env: + WORKFLOW_CONTEXT: ${{ github.event.workflow_run.conclusion }} + run: | + echo "Running pr-deploy-and-test..." + echo $"WORKFLOW_CONTEXT" + echo "---" + + on-quality-checks-success: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - run: echo "The Quality Checks workflow passed" + + on-quality-checks-failure: + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - run: echo "The Quality Checks workflow failed" + + deploy-internal-dev-backend: + needs: [on-quality-checks-success] uses: ./.github/workflows/deploy-backend.yml with: apigee_environment: internal-dev diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index 8a8654ebff..6a50498b16 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -36,6 +36,7 @@ jobs: lint-python: name: Lint Python projects runs-on: ubuntu-latest + needs: [lint-specification] steps: - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 @@ -63,6 +64,7 @@ jobs: lint-terraform: name: Lint Terraform projects runs-on: ubuntu-latest + needs: [lint-python] steps: - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 @@ -77,6 +79,7 @@ jobs: testcoverage_and_sonarcloud: name: Test Coverage and SonarCloud runs-on: ubuntu-latest + needs: [lint-terraform] steps: - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98