-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
54 lines (43 loc) · 1.35 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
stages:
- build
- test
# 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
# The cache concept is also under consideration and nice to have so far
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:
- .npm
- cache/Cypress
- node_modules
# This job installs NPM dependencies and Cypress as a build stage
# Install is basically doing the same as in the Docker file
install:
# Installes Node 12.13.0, Chrome 80 and Firefox 74:
image: cypress/browsers:node12.13.0-chrome80-ff74
stage: build
script:
- npm ci
# 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
Run test:
image: cypress/browsers:node12.13.0-chrome80-ff74
stage: test
script:
# Runs and skips WiP tests
- npm run test -- --env TAGS='not @skip'
# Saves artefacts for you to review, especially when tests fail
artifacts:
when: always
paths:
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*.png