-
-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (45 loc) · 1.18 KB
/
run-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Run Test Cases
# Run on all branch
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox]
steps:
- name: Checkout
uses: actions/checkout@v3
# Cache node modules
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Install NPM dependencies
- name: Install dependencies
run: npm ci
# Cache Cypress files
- name: Cache Cypress
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ github.run_id }}
# Cypress run
- name: Cypress run
uses: cypress-io/github-action@v5
with:
component: true
browser: ${{ matrix.browser }}
env:
# Disable GPU acceleration for headless browsers
CYPRESS_runTestsInHeadlessMode: '--disable-gpu'