forked from cypress-io/cypress-example-kitchensink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
31 lines (29 loc) · 847 Bytes
/
.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
# 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:
- .npm
- cache/Cypress
test:
image: cypress/base:20.11.0
stage: test
script:
- npm ci
# print CI environment variables for reference
- npx print-env CI
# make sure Cypress can run
- npm run cy:verify
# start the server in the background
- npm run start &
# run Cypress test in load balancing mode, pass id to tie jobs together
- npm run e2e:record
artifacts:
paths:
- cypress/screenshots
expire_in: 1 day