From 090081ac8775d042a61fa841984023804e9b7011 Mon Sep 17 00:00:00 2001 From: Niraj Date: Wed, 29 Jan 2025 18:22:09 +0545 Subject: [PATCH 1/3] chore: update workflow triggers for backend and integration tests to depend on the test stack --- .github/workflows/test_backend.yml | 6 +++--- .github/workflows/test_integration_playwright.yml | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index bc5bec70a..f5563c9c9 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -1,9 +1,6 @@ name: Backend Test on: - push: - branches: - - test workflow_dispatch: inputs: deployment: @@ -26,6 +23,9 @@ on: - "preview" - "mainnet" - "preprod" + workflow_run: + workflows: ["Build and deploy GovTool test stack"] + types: [completed] jobs: backend-tests: diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index 4c99c6bf2..0ddb9105e 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -1,9 +1,6 @@ name: Integration Test [Playwright] on: - push: - branches: - - test workflow_dispatch: inputs: deployment: @@ -27,7 +24,7 @@ on: - "preprod" workflow_run: - workflows: ["Build and deploy GovTool to TEST server"] + workflows: ["Build and deploy GovTool test stack"] types: [completed] jobs: From 4c15cd31d775ef410ecbc7918061d1e956553ad0 Mon Sep 17 00:00:00 2001 From: Niraj Date: Thu, 30 Jan 2025 10:17:54 +0545 Subject: [PATCH 2/3] chore: make default test runner env to govtool.cardanoapi.io --- .github/workflows/test_backend.yml | 2 +- .github/workflows/test_integration_playwright.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index f5563c9c9..1adf68508 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -6,7 +6,7 @@ on: deployment: required: true type: choice - default: "z6b8d2f7a-zca4a4c45-gtw.z937eb260.rustrocks.fr" + default: "govtool.cardanoapi.io/api" options: - "sanchogov.tools/api" - "staging.govtool.byron.network/api" diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index 0ddb9105e..197ab9942 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -6,7 +6,7 @@ on: deployment: required: true type: choice - default: "preview.gov.tools" + default: "govtool.cardanoapi.io" options: - "sanchogov.tools" - "staging.govtool.byron.network" From 4258e92033aac66a512ceb03619d7927fe666c81 Mon Sep 17 00:00:00 2001 From: Niraj Date: Thu, 30 Jan 2025 10:52:43 +0545 Subject: [PATCH 3/3] chore: update test workflow to run only on deployment success --- .github/workflows/test_backend.yml | 3 ++- .github/workflows/test_integration_playwright.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index 1adf68508..22ccffaa0 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -30,6 +30,7 @@ on: jobs: backend-tests: runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -68,7 +69,7 @@ jobs: publish-report: runs-on: ubuntu-latest - if: always() + if: always() && needs.backend-tests.result != 'skipped' needs: backend-tests steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index 197ab9942..b00cee48f 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -30,6 +30,7 @@ on: jobs: integration-tests: runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} defaults: run: working-directory: tests/govtool-frontend/playwright @@ -108,7 +109,7 @@ jobs: publish-report: runs-on: ubuntu-latest - if: always() + if: always() && needs.integration-tests.result != 'skipped' needs: integration-tests steps: - uses: actions/checkout@v4