-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (36 loc) · 1.05 KB
/
test.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
name: Tests
on: pull_request
jobs:
setup:
name: Setup tests
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel preview deployment to be ready
uses: patrickedqvist/wait-for-vercel-preview@v1.2.0
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 60
test:
name: Run Cypress
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node_modules and Cypress
uses: actions/cache@v3
with:
path: |
~/.cache/Cypress
node_modules
key: pushups-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Cypress
run: npm i cypress
- name: Run Cypress
uses: cypress-io/github-action@v4
with:
config: baseUrl=${{ needs.setup.outputs.preview_url }}
spec: cypress/e2e/test.cy.js
install: false