From a5bae135cd89424dab0e9f30c6dfb3bb749a50ec Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 4 Dec 2023 18:02:08 +0000 Subject: [PATCH] revert to wait-for-vercel-deployment --- .github/workflows/cypress-release-test.yml | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress-release-test.yml b/.github/workflows/cypress-release-test.yml index 1a00da21..934c9d7f 100644 --- a/.github/workflows/cypress-release-test.yml +++ b/.github/workflows/cypress-release-test.yml @@ -1,12 +1,30 @@ name: Cypress release tests on: - deployment_status: + pull_request: + branches: + - main jobs: + # vercel will redeploy the develop/staging app on creating a PR to main + # wait for new deployment to complete before running tests + wait-for-vercel-deployment: + name: Wait for vercel deployment + runs-on: ubuntu-latest + outputs: + preview_url: ${{ steps.waitForVercelDeployment.outputs.url }} + steps: + - name: Wait for Vercel preview deployment to be ready + uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 + id: waitForVercelDeployment + with: + token: ${{ secrets.GITHUB_TOKEN }} + max_timeout: 1000 + check_interval: 5 + cypress-run: name: Cypress e2e tests - if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && github.ref == 'refs/heads/develop' + needs: wait-for-vercel-deployment runs-on: ubuntu-latest strategy: # when one test fails, DO NOT cancel the other @@ -40,7 +58,7 @@ jobs: NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}} NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }} - CYPRESS_BASE_URL: ${{ github.event.deployment_status.environment_url }} + CYPRESS_BASE_URL: ${{ needs.wait-for-vercel-deployment.outputs.preview_url }} CYPRESS_mail_slurp_api_key: ${{secrets.CYPRESS_MAIL_SLURP_API_KEY}} CYPRESS_inbox_id: ${{secrets.CYPRESS_INBOX_ID}} CYPRESS_reset_pwd_content_email: ${{secrets.CYPRESS_RESET_PWD_CONTENT_EMAIL}}