I have successfully created a script to test Vercel test deployments using Cypress integrated with Github Actions. Although the test works and the desired result is achieved, there is a slightly annoying issue-- the Cypress test runs (and is skipped) before the Vercel deployment attempt. I am employing a conditional in the GA workflow yml so that the Cypress tests run after successful test deployment, so it ends up running after the deployment. I would like to be able to omit the first skipped attempt at the Cypress test. I have tried incorporating other Github Actions to fix this, but they block the test from being run at all if the deployment is not finished. I have also tried playing with the settings of the repo, to no avail. Below is my GA yml:
name: Cypress Testing
on: [deployment_status]
jobs:
e2e:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_AUTH_TOKEN}}" > .npmrc
- name: Setup npm package
run: npm init -y && npm install
- name: Setup node 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Run Cypress
uses: cypress-io/github-action@v2
env:
CYPRESS_BASE_URL: ${{ github.event.deployment_status.target_url }}
Our Vercel project is integrated with Git, so it deploys automatically with every push. Has anyone ever had this issue, where Cypress tries to run first before Vercel deployment?