From 6e411c893b9359566c7093db95a5d4613bbaf3a9 Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Mon, 22 Apr 2024 23:08:22 +0200 Subject: [PATCH] ci: run k6 tests regardless if previous jobs skipped --- .github/workflows/ci-cd-main.yml | 4 +++- .github/workflows/ci-cd-staging.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-main.yml b/.github/workflows/ci-cd-main.yml index 769684bf5..feac5187d 100644 --- a/.github/workflows/ci-cd-main.yml +++ b/.github/workflows/ci-cd-main.yml @@ -123,7 +123,9 @@ jobs: run-e2e-tests: name: "Run K6 functional end-to-end tests" - needs: [deploy-apps-test] + # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests + if: ${{ always() && !failure() && !cancelled() && needs.check-for-changes.outputs.hasBackendChanges == 'true' }} + needs: [deploy-apps-test, check-for-changes] uses: ./.github/workflows/action-run-k6-tests.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} diff --git a/.github/workflows/ci-cd-staging.yml b/.github/workflows/ci-cd-staging.yml index 02cd622ac..e4f4be55e 100644 --- a/.github/workflows/ci-cd-staging.yml +++ b/.github/workflows/ci-cd-staging.yml @@ -70,7 +70,9 @@ jobs: run-e2e-tests: name: "Run K6 functional end-to-end tests" - needs: [deploy-apps-staging] + # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests + if: ${{ always() && !failure() && !cancelled() && needs.check-for-changes.outputs.hasBackendChanges == 'true' }} + needs: [deploy-apps-staging, check-for-changes] uses: ./.github/workflows/action-run-k6-tests.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}