fixed #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: End-to-end tests | |
on: push | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Wait for Netlify deploy-preview URL | |
id: wait-for-url | |
run: | | |
retries=0 | |
max_retries=5 | |
while [[ $retries -lt $max_retries ]]; do | |
export DEPLOY_PREVIEW_URL=$(curl -s https://api.netlify.com/api/v1/sites/96256700-655b-4aa1-ba80-94fc59aafb69/deploys | jq -r '.[0].ssl_url') | |
if [ -n "$DEPLOY_PREVIEW_URL" ]; then | |
echo "Deploy-preview URL is available: $DEPLOY_PREVIEW_URL" | |
break | |
else | |
echo "Waiting for deploy-preview URL..." | |
sleep 60 # Wait for 60 seconds before checking again | |
retries=$((retries+1)) | |
fi | |
done | |
- name: Set Cypress baseUrl from Netlify | |
run: echo "export CYPRESS_BASE_URL=$DEPLOY_PREVIEW_URL" >> $GITHUB_ENV | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install Cypress | |
run: npm install cypress | |
- name: Cypress run | |
run: npx cypress run --config baseUrl=${CYPRESS_BASE_URL} |