-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
80 lines (70 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
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
image: node:12-alpine
stages:
- install
- test
- audit
.run_in_master: &run_in_master
if: '$CI_COMMIT_REF_NAME == "master"'
when: on_success
.run_in_mr: &run_in_mr
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
.run_on_schedule: &run_on_schedule
if: '$CI_PIPELINE_SOURCE == "schedule"'
when: on_success
.do_not_run_otherwise: &do_not_run_otherwise
when: never
.base:
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 200
cache:
key: lighthouse-datadog-${CI_COMMIT_REF_SLUG}
paths:
- node_modules
policy: pull
rules:
- *run_in_master
- *run_in_mr
- *run_on_schedule
- *do_not_run_otherwise
before_script:
- yarn install --frozen-lockfile
Install:
stage: install
extends: .base
cache:
policy: pull-push
script:
- echo "Dependencies installed"
Unit test:
stage: test
extends: .base
rules:
- *run_in_master
- *run_in_mr
- *do_not_run_otherwise
script:
- yarn test:unit
Lint:
stage: test
extends: .base
rules:
- *run_in_master
- *run_in_mr
- *do_not_run_otherwise
script:
- yarn lint
Audit:
stage: audit
extends: .base
image: cypress/browsers:latest
rules:
- *run_on_schedule
- *do_not_run_otherwise
script:
- yarn lighthouse:audit
artifacts:
paths:
- lighthouse-reports/*
expire_in: 1 week