-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (38 loc) · 1.15 KB
/
cy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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: $?"