From da731f3d82bc662222c1540df352628a715a539f Mon Sep 17 00:00:00 2001 From: Adel Bensaad Date: Wed, 24 Apr 2024 11:09:15 +0100 Subject: [PATCH] chore: optimize Cypress recordings with conditional triggers --- .github/workflows/e2e-tests.yml | 4 ++-- .github/workflows/verify-app.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index d1cf66c452..e15c01eba9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -99,7 +99,7 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: - record: true + record: ${{ contains(github.event.pull_request.title, '[e2e record]') || contains(github.event.head_commit.message, '[e2e record]') }} parallel: true group: e2e-chrome-parallel-${{ matrix.versions }} browser: chrome @@ -108,7 +108,7 @@ jobs: wait-on-timeout: 300 env: CI: true - CYPRESS_RECORD_KEY: '6b0bce0d-a4e8-417b-bbee-9157cbe9a999' + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} diff --git a/.github/workflows/verify-app.yml b/.github/workflows/verify-app.yml index 4877b7ceed..05e200d586 100644 --- a/.github/workflows/verify-app.yml +++ b/.github/workflows/verify-app.yml @@ -126,7 +126,7 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: - record: true + record: ${{ contains(github.event.pull_request.title, '[e2e record]') || contains(github.event.head_commit.message, '[e2e record]') }} parallel: true group: e2e-chrome-parallel-dev browser: chrome @@ -135,7 +135,7 @@ jobs: wait-on-timeout: 300 env: CI: true - CYPRESS_RECORD_KEY: '6b0bce0d-a4e8-417b-bbee-9157cbe9a999' + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CYPRESS_dhis2BaseUrl: ${{ secrets.CYPRESS_DHIS2_INSTANCES_BASE_URL }}/ca-test-dev CYPRESS_dhis2InstanceVersion: ${{ needs.instance-version.outputs.version }}