-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
76 lines (65 loc) · 1.78 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
variables:
KUBERNETES_CPU_REQUEST: 2
RUNNER_REQUEST_CONCURRENCY: 2 # I think KUBERNETES_CPU_REQUEST x RUNNER_REQUEST_CONCURRENCY should be less than 8
KUBERNETES_MEMORY_LIMIT: 4Gi
KUBERNETES_MEMORY_REQUEST: 4Gi
# DOCKER_TLS_CERTDIR: "/certs"
# DOCKER_TLS_VERIFY: 1
# DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
cache:
key:
files:
- yarn.lock
paths:
- cache/Cypress
- .yarn/cache
- build
stages:
- build
- test
build:
stage: build
image: docker:cli
services:
- name: docker:dind
alias: docker
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
# wait for docker service to be ready
- i=0; while [ "$i" -lt 12 ]; do docker info >/dev/null && break; sleep 5; i=$(( i + 1 )) ; done
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -f docker/e2e.Dockerfile -t $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $TEST == null
changes: # I don't see this working?
- docker/e2e.Dockerfile
- yarn.lock
.tests:
stage: test
timeout: 1h 30m
image: $CI_REGISTRY_IMAGE:latest
before_script:
- yarn install --immutable
- git config --global user.email "$GITLAB_USER_EMAIL"
- git config --global user.name "$GITLAB_USER_NAME"
artifacts:
when: always
paths:
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*
expire_in: 1 day
include: .gitlab/generated/tests.yml
command:
extends: .tests
timeout: 3h
script:
- eval $CY_COMMAND
rules:
- if: $TEST == "command"