-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.gitlab-ci.yml
103 lines (94 loc) · 2.44 KB
/
.gitlab-ci.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
stages:
- install
- quality
- e2e
# - build
# to cache both npm modules and Cypress binary we use environment variables
# to point at the folders we can list as paths in "cache" job settings
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
- .npm
- cache/Cypress
# this job installs NPM dependencies and Cypress
install:
stage: install
image: cypress/browsers:node14.15.0-chrome86-ff82
script:
- npm install
# check Cypress binary path and cached versions
# useful to make sure we are not carrying around old versions
- npx cypress cache path
- npx cypress cache list
- npx cypress verify
- npx cypress info
artifacts:
name: "artifacts"
untracked: true
expire_in: 30 mins
paths:
- node_modules
# quality:lint:
# stage: quality
# image: cypress/browsers:node14.15.0-chrome86-ff82
# script:
# - npm run lint
quality:unit:
stage: quality
image: cypress/browsers:node14.15.0-chrome86-ff82
script:
- npm run test:cover
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
e2e:chrome:
stage: e2e
image: cypress/browsers:node14.15.0-chrome86-ff82
script:
# - npm install
# - npx cypress install
# start the server in the background
- npm run start:ci &
# run Cypress test in load balancing mode
- npx cypress run --record --key 1eeb9ee4-c447-4459-9086-2327b856e9f6 --browser chrome
only:
- external_pull_requests
artifacts:
when: always
paths:
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*.png
expire_in: 1 day
e2e:firefox:
stage: e2e
image: cypress/browsers:node14.15.0-chrome86-ff82
script:
# - npm install
# - npx cypress install
# start the server in the background
- npm run start:ci &
# run Cypress test in load balancing mode
- npx cypress run --record --key 1eeb9ee4-c447-4459-9086-2327b856e9f6 --browser firefox
# --config "viewportWidth=375,viewportHeight=667"
only:
- external_pull_requests
artifacts:
when: always
paths:
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*.png
expire_in: 1 day
# build:
# stage: build
# script:
# - CI=false npm run build
# artifacts:
# paths:
# - build
# expire_in: 30 mins
# dependencies:
# - install