-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (38 loc) · 1.19 KB
/
cypress-tests.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
name: Run Cypress tests on pull requests to main
on:
pull_request:
branches:
- main
jobs:
cypress-tests:
runs-on: ubuntu-latest
env:
DEV_AUTH: ${{ secrets.DEV_AUTH }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm # The directory to cache (this is for npm; use "node_modules" if you're not using a global cache)
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Cache key based on OS and lock file
restore-keys: |
${{ runner.os }}-node- # Fallback if an exact match is not found
- name: Install dependencies
run: npm install
- name: Setup temp build
run: make
- name: Start dev server
run: npm start &
- name: Run Cypress tests
run: npx cypress run
- name: Upload Cypress artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-artifacts
path: cypress/videos