Talha/das 463 #33
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: Cypress Tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
cypress: | |
runs-on: ubuntu-latest | |
env: | |
USERNAME: ${{ secrets.USERNAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Get PR number | |
id: pr_number | |
run: echo "PR_NUMBER=$(echo $GITHUB_REF | sed -n 's/refs\/pull\/\([0-9]*\)\/merge/\1/p')" >> $GITHUB_ENV | |
- name: Replace URL and running cypress test | |
run: | | |
sed -i 's/baseUrl: .*/baseUrl: "https:\/\/deploy-preview-${{ env.PR_NUMBER }}--zenml-ui-staging.netlify.app",/' cypress.config.ts | |
- name: Run e2e tests | |
run: | | |
export USERNAME=$USERNAME | |
export PASSWORD=$PASSWORD | |
npx cypress run | |
# - name: Run Cypress tests | |
# run: npx cypress run | |
# continue-on-error: true | |
- name: Check Cypress exit code | |
run: | | |
echo "Cypress Exit Code: $?" |