From 339c0b4aa4d92606d41aea8c9af51b0078efcbe5 Mon Sep 17 00:00:00 2001 From: Gosha Date: Mon, 11 Sep 2023 20:35:47 +0300 Subject: [PATCH 1/2] feat: skip ee tests if no token --- .github/workflows/test.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 713ede9b88a..3c9f456e731 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -227,11 +227,26 @@ jobs: targets: test:e2e projects: ${{matrix.projectName}} + check_submodule_token: + name: Check if the secret exists or not. + runs-on: ubuntu-latest + outputs: + has_token: ${{ steps.secret-check.outputs.has_token }} + steps: + - name: Check if secret exists + id: secret-check + run: | + if [[ -n "${{ secrets.SUBMODULES_TOKEN }}" ]]; then + echo "::set-output name=has_token::true" + else + echo "::set-output name=has_token::false" + fi + test_e2e_ee: name: Test E2E EE runs-on: ubuntu-latest - needs: [get-affected] - if: ${{ fromJson(needs.get-affected.outputs.test-e2e-ee)[0] }} + needs: [get-affected, check_submodule_token] + if: ${{ fromJson(needs.get-affected.outputs.test-e2e-ee)[0] }} && needs.check_submodule_token.outputs.has_token == 'true' timeout-minutes: 80 strategy: # One job for each different project and node version From 6a2adbb50042e21ac2fc00f89633866e9e2b5026 Mon Sep 17 00:00:00 2001 From: Gosha Date: Tue, 12 Sep 2023 09:44:53 +0300 Subject: [PATCH 2/2] fix: if conditions --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c9f456e731..9a172b47045 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -246,7 +246,7 @@ jobs: name: Test E2E EE runs-on: ubuntu-latest needs: [get-affected, check_submodule_token] - if: ${{ fromJson(needs.get-affected.outputs.test-e2e-ee)[0] }} && needs.check_submodule_token.outputs.has_token == 'true' + if: ${{ fromJson(needs.get-affected.outputs.test-e2e-ee)[0] && needs.check_submodule_token.outputs.has_token == 'true' }} timeout-minutes: 80 strategy: # One job for each different project and node version