Newer
Older
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
- npm ci
artifacts:
name: "artifacts"
untracked: true
expire_in: 60 mins
paths:
- .npm/
- node_modules/
build:
stage: build
script:
- CI=false npm run build
artifacts:
paths:
- build
expire_in: 60 mins
dependencies:
- install
linting:
stage: quality
script:
- npm run lint
dependencies:
- install
test:unit:
stage: quality
script:
- npm run test:unit
dependencies:
- install
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
# test:e2e:
# stage: quality
# image: cypress/browsers:chrome69
# dependencies:
# - install
# - build
# script:
# - npm run e2e:ci
# artifacts:
# paths:
# - cypress/screenshots
# - cypress/videos
# expire_in: 1 day
# .deploy:
# stage: deploy
# before_script:
# - npm install -g firebase-tools
# - (if [ -d "build" ]; then echo ok; else exit "no build folder, try to run pipeline again"; fi);
# script:
# - firebase deploy --token $FIREBASE_TOKEN --non-interactive --only hosting:$ENV
# when: manual
# deploy_to_alpha:
# environment:
# name: alpha
# url: $ALPHA_URL
# extends: .deploy
# variables:
# ENV: alpha
# except:
# - develop
# - main
# deploy_to_beta:
# environment:
# name: beta
# url: $BETA_URL
# extends: .deploy
# variables:
# ENV: beta
# only:
# - develop
# deploy_to_prod:
# environment:
# name: prod
# url: $PROD_URL
# extends: .deploy
# variables:
# ENV: prod
# only:
# refs:
# - main
.lighthouse:
image: markhobson/node-chrome
stage: audit
before_script:
- npm i -g lighthouse
script:
- lighthouse --chrome-flags="--headless --no-sandbox" $LIGHTHOUSE_TEST_URL --output html --output-path ./report.html
artifacts:
paths:
- ./report.html
expire_in: 1 week
when: manual
# run_lighthouse_alpha:
# extends: .lighthouse
# variables:
# LIGHTHOUSE_TEST_URL: $ALPHA_URL
# except:
# - develop
# - main
# run_lighthouse_beta:
# extends: .lighthouse
# variables:
# LIGHTHOUSE_TEST_URL: $BETA_URL
# only:
# - develop
run_lighthouse_prod:
extends: .lighthouse
variables:
LIGHTHOUSE_TEST_URL: $PROD_URL
only:
- main