From 5cf6c11d36b05216c69dd93f0817780e398cfa50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Tue, 8 Nov 2022 16:58:46 +0100 Subject: [PATCH] chore: change condition check directly in test job (#1989) It fixes the issue with required jobs in PR. --- .github/workflows/capsule-cypress-night-run.yml | 2 +- .github/workflows/cypress-console-lite-e2e.yml | 5 +++++ .github/workflows/cypress-explorer-e2e.yml | 5 +++++ .../cypress-liquidity-provision-dashboard-e2e.yml | 9 ++++++++- .github/workflows/cypress-stats-e2e.yml | 9 ++++++++- .github/workflows/cypress-token-e2e.yml | 5 +++++ .github/workflows/cypress-trading-e2e.yml | 5 +++++ .github/workflows/tests-dispatcher.yml | 14 ++++++++------ 8 files changed, 45 insertions(+), 9 deletions(-) diff --git a/.github/workflows/capsule-cypress-night-run.yml b/.github/workflows/capsule-cypress-night-run.yml index 052538828..30f7f175b 100644 --- a/.github/workflows/capsule-cypress-night-run.yml +++ b/.github/workflows/capsule-cypress-night-run.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/tests-dispatcher.yml secrets: inherit with: - project: '[console-lite-e2e, explorer-e2e, liquidity-provisioning-dashboard-e2e, stats-e2e, token-e2e, trading-e2e]' + project: '[console-lite-e2e, explorer-e2e, liquidity-provision-dashboard-e2e, stats-e2e, token-e2e, trading-e2e]' vega-version: 'v0.58.0' gobin: /home/runner/go/bin tags: --env.grepTags '[ @smoke, @regression, @slow ]' diff --git a/.github/workflows/cypress-console-lite-e2e.yml b/.github/workflows/cypress-console-lite-e2e.yml index 55ea8acf0..160eb7a19 100644 --- a/.github/workflows/cypress-console-lite-e2e.yml +++ b/.github/workflows/cypress-console-lite-e2e.yml @@ -3,6 +3,10 @@ name: Cypress - console-lite on: workflow_call: inputs: + trigger: + required: true + type: string + default: 'false' vega-version: required: true type: string @@ -19,6 +23,7 @@ on: jobs: console-lite-e2e: + if: ${{ inputs.trigger == 'true' }} runs-on: self-hosted steps: # Add GOBIN to PATH diff --git a/.github/workflows/cypress-explorer-e2e.yml b/.github/workflows/cypress-explorer-e2e.yml index 81a956cd9..8907e3e4b 100644 --- a/.github/workflows/cypress-explorer-e2e.yml +++ b/.github/workflows/cypress-explorer-e2e.yml @@ -3,6 +3,10 @@ name: Cypress - explorer on: workflow_call: inputs: + trigger: + required: true + type: string + default: 'false' vega-version: required: true type: string @@ -23,6 +27,7 @@ on: jobs: explorer-e2e: + if: ${{ inputs.trigger == 'true' }} runs-on: self-hosted timeout-minutes: 30 steps: diff --git a/.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml b/.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml index 7bbd7a36e..9d808375f 100644 --- a/.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml +++ b/.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml @@ -1,10 +1,17 @@ name: Cypress - liquidity provision dashboard -on: workflow_call +on: + workflow_call: + inputs: + trigger: + required: true + type: string + default: 'false' jobs: liquidity-provision-dashboard-e2e: timeout-minutes: 10 + if: ${{ inputs.trigger == 'true' }} runs-on: self-hosted steps: # Checkout front ends diff --git a/.github/workflows/cypress-stats-e2e.yml b/.github/workflows/cypress-stats-e2e.yml index 9feb7d516..3e6a20f45 100644 --- a/.github/workflows/cypress-stats-e2e.yml +++ b/.github/workflows/cypress-stats-e2e.yml @@ -1,10 +1,17 @@ name: Cypress - stats -on: workflow_call +on: + workflow_call: + inputs: + trigger: + required: true + type: string + default: 'false' jobs: stats-e2e: runs-on: self-hosted + if: ${{ inputs.trigger == 'true' }} timeout-minutes: 10 steps: # Checkout front ends diff --git a/.github/workflows/cypress-token-e2e.yml b/.github/workflows/cypress-token-e2e.yml index fad6ff8c7..832bad61c 100644 --- a/.github/workflows/cypress-token-e2e.yml +++ b/.github/workflows/cypress-token-e2e.yml @@ -3,6 +3,10 @@ name: Cypress - token on: workflow_call: inputs: + trigger: + required: true + type: string + default: 'false' vega-version: required: true type: string @@ -19,6 +23,7 @@ on: jobs: token-e2e: + if: ${{ inputs.trigger == 'true' }} runs-on: self-hosted timeout-minutes: 60 steps: diff --git a/.github/workflows/cypress-trading-e2e.yml b/.github/workflows/cypress-trading-e2e.yml index 9a6325110..b75a6b2a7 100644 --- a/.github/workflows/cypress-trading-e2e.yml +++ b/.github/workflows/cypress-trading-e2e.yml @@ -3,6 +3,10 @@ name: Cypress - trading on: workflow_call: inputs: + trigger: + required: true + type: string + default: 'false' vega-version: required: true type: string @@ -19,6 +23,7 @@ on: jobs: trading-e2e: + if: ${{ inputs.trigger == 'true' }} timeout-minutes: 30 runs-on: self-hosted steps: diff --git a/.github/workflows/tests-dispatcher.yml b/.github/workflows/tests-dispatcher.yml index 5c84598e1..e5dd6cb11 100644 --- a/.github/workflows/tests-dispatcher.yml +++ b/.github/workflows/tests-dispatcher.yml @@ -23,20 +23,20 @@ on: jobs: run-console-lite-e2e: - if: ${{ contains(inputs.project, 'console-lite-e2e') || contains(inputs.project, 'console-lite') }} uses: ./.github/workflows/cypress-console-lite-e2e.yml secrets: inherit with: + trigger: ${{ contains(inputs.project, 'console-lite-e2e') || contains(inputs.project, 'console-lite') }} vega-version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} skip-cache: ${{ inputs.skip-cache }} tags: ${{ inputs.tags }} run-explorer-e2e: - if: ${{ contains(inputs.project, 'explorer-e2e') || contains(inputs.project, 'explorer') }} uses: ./.github/workflows/cypress-explorer-e2e.yml secrets: inherit with: + trigger: ${{ contains(inputs.project, 'explorer-e2e') || contains(inputs.project, 'explorer') }} vega-version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} skip-cache: ${{ inputs.skip-cache }} @@ -44,30 +44,32 @@ jobs: night-run: ${{ inputs.night-run }} run-liquidity-e2e: - if: ${{ contains(inputs.project, 'liquidity-provision-dashboard-e2e') || contains(inputs.project, 'liquidity-provision-dashboard') }} uses: ./.github/workflows/cypress-liquidity-provision-dashboard-e2e.yml secrets: inherit + with: + trigger: ${{ contains(inputs.project, 'liquidity-provision-dashboard-e2e') || contains(inputs.project, 'liquidity-provision-dashboard') }} run-stats-e2e: - if: ${{ contains(inputs.project, 'stats-e2e') || contains(inputs.project, 'stats') }} uses: ./.github/workflows/cypress-stats-e2e.yml secrets: inherit + with: + trigger: ${{ contains(inputs.project, 'stats-e2e') || contains(inputs.project, 'stats') }} run-token-e2e: - if: ${{ contains(inputs.project, 'token-e2e') || contains(inputs.project, 'token') }} uses: ./.github/workflows/cypress-token-e2e.yml secrets: inherit with: + trigger: ${{ contains(inputs.project, 'token-e2e') || contains(inputs.project, 'token') }} vega-version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} skip-cache: ${{ inputs.skip-cache }} tags: ${{ inputs.tags }} run-trading-e2e: - if: ${{ contains(inputs.project, 'trading-e2e') || contains(inputs.project, 'trading') }} uses: ./.github/workflows/cypress-trading-e2e.yml secrets: inherit with: + trigger: ${{ contains(inputs.project, 'trading-e2e') || contains(inputs.project, 'trading') }} vega-version: ${{ inputs.vega-version }} gobin: ${{ inputs.gobin }} skip-cache: ${{ inputs.skip-cache }}