From 0d5ebc22fac8afc93eb6e19642a6a8029867567c Mon Sep 17 00:00:00 2001 From: wdbasson Date: Tue, 26 Mar 2024 12:59:48 +0200 Subject: [PATCH] Ability to skip tests when doing workflow dispatch (#706) --- .github/workflows/continuous-deploy.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml index b937a2fdd..7e5070546 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/continuous-deploy.yml @@ -11,7 +11,7 @@ on: run-tests: description: "Run tests step" required: false - default: false + default: true type: boolean push: @@ -527,7 +527,7 @@ jobs: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - name: Helmfile apply pytest - # if: github.event.review.state == 'approved' || github.event_name == 'push' || ( github.event.inputs.run-reset-deployments == 'true' && github.event.inputs.run-tests == 'true' ) || github.event.inputs.run-tests == 'true' + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} id: pytest uses: helmfile/helmfile-action@v1.8.0 with: @@ -547,7 +547,7 @@ jobs: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - name: Wait for pytest and print logs - # if: github.event.review.state == 'approved' || github.event_name == 'push' || ( github.event.inputs.run-reset-deployments == 'true' && github.event.inputs.run-tests == 'true' ) || github.event.inputs.run-tests == 'true' + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} run: | while true; do # Check if the job is complete or failed @@ -578,7 +578,7 @@ jobs: NAMESPACE: dev-cloudapi - name: Copy k8s pytest results - # if: github.event.review.state == 'approved' || github.event_name == 'push' || ( github.event.inputs.run-reset-deployments == 'true' && github.event.inputs.run-tests == 'true' ) || github.event.inputs.run-tests == 'true' + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} run: | echo "apiVersion: v1 kind: Pod @@ -625,7 +625,7 @@ jobs: - name: Publish Test Report uses: mikepenz/action-junit-report@v4 - if: always() + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} with: report_paths: "./test_output.xml" fail_on_failure: true @@ -633,7 +633,7 @@ jobs: require_passed_tests: true - name: Pytest coverage comment - if: github.event_name == 'pull_request' + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} uses: MishaKav/pytest-coverage-comment@v1.1.51 with: pytest-coverage-path: ./test_coverage.txt