-
Notifications
You must be signed in to change notification settings - Fork 14
72 lines (62 loc) · 1.95 KB
/
integration.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: E2E Test
on: [pull_request]
jobs:
cypress:
name: Cypress
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['16.16.0']
os: [ubuntu-latest]
env:
CYPRESS_CACHE_FOLDER: '.cache/cypress_install'
# Cypress Docker image with Chrome v78
# and Firefox v70 pre-installed
container: cypress/browsers:latest
steps:
- uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
id: npm-cache
uses: actions/cache@v3
env:
cache-name: cache-node-modules-v3
with:
path: |
.npm
${{ env.CYPRESS_CACHE_FOLDER }}
node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies if needed.
if: steps.npm-cache.outputs.cache-hit != 'true'
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: npm ci
- name: Cypress run
uses: cypress-io/github-action@v4
with:
# we have already installed everything
install: false
start: npm run start:e2e
wait-on: 'http://localhost:3001'
wait-on-timeout: 120
- name: upload Cypress screenshots for failed tests
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: upload Cypress test run video
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos