From 14c3e032f4dfa1f5e2e7fc687b0350070a5329d1 Mon Sep 17 00:00:00 2001 From: Andrew Pearce Date: Wed, 25 Oct 2023 09:51:44 +0100 Subject: [PATCH] MLPAB-1513 - Do not allow End of Workflow to be skipped (#799) * end of workflow success if ui test successful else fail the deployment --- .github/workflows/workflow_pr.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow_pr.yml b/.github/workflows/workflow_pr.yml index 60a70fd158..0f56762841 100644 --- a/.github/workflows/workflow_pr.yml +++ b/.github/workflows/workflow_pr.yml @@ -96,7 +96,7 @@ jobs: with: run_against_image: true tag: ${{ needs.create_tags.outputs.version_tag }} - smoke: ${{ contains(fromJSON('["MLPAB-1419-use-a-single-persistent-environment-for-weblate-changes-optimise-workflow", "weblate-pr"]'), github.head_ref) }} + smoke: ${{ contains(fromJSON('["weblate-pr"]'), github.head_ref) }} secrets: aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_ACTIONS }} aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ACTIONS }} @@ -157,11 +157,8 @@ jobs: end_of_pr_workflow: name: End of PR Workflow - if: always() && - needs.pr_deploy.result == 'success' && - needs.create_tags.result == 'success' && - needs.ui_tests_pr_env.result == 'success' runs-on: ubuntu-latest + if: always() environment: name: "dev_${{ needs.create_tags.outputs.environment_workspace_name }}" url: "https://${{ needs.pr_deploy.outputs.url }}" @@ -172,3 +169,11 @@ jobs: echo "${{ needs.pr_deploy.outputs.terraform_workspace_name }} PR environment tested, built and deployed" echo "Tag Deployed: ${{ needs.pr_deploy.outputs.terraform_container_version }}" echo "URL: https://${{ needs.pr_deploy.outputs.url }}" + if ${{ contains(needs.ui_tests_pr_env.result,'success') }} + then + echo "PR environment tested, built and deployed" + exit 0 + else + echo "PR environment tested, built and deployed but UI tests failed" + exit 1 + fi