forked from cypress-io/cypress-realworld-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (65 loc) · 2.3 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
# Install Cypress, then run all tests (in parallel)
stages:
- build
- test
# Set environment variables for folders in "cache" job settings for npm modules and Cypress binary
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:
- .cache/*
- cache/Cypress
- node_modules
- build
# Install NPM dependencies and Cypress
install:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: build
script:
- yarn install --frozen-lockfile
# check Cypress binary path and cached versions
- npx cypress cache path
- npx cypress cache list
- yarn types
- yarn lint
- yarn test:unit:ci
- yarn build:ci
api-tests:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 5
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "API" --spec "cypress/tests/api/*"
ui-chrome:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 5
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "UI - Chrome" --spec "cypress/tests/ui/*"
ui-chrome-mobile:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 5
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser chrome --group "UI - Chrome - Mobile" --spec "cypress/tests/ui/*" --config "viewportWidth=375,viewportHeight=667"
ui-firefox:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 5
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser firefox --group "UI - Firefox" --spec "cypress/tests/ui/*"
ui-firefox-mobile:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
stage: test
parallel: 5
script:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser firefox --group "UI - Firefox - Mobile" --spec "cypress/tests/ui/*" --config "viewportWidth=375,viewportHeight=667"