-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
139 lines (135 loc) · 3.69 KB
/
config.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
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
version: 2.1
parameters:
dependency-cache-version:
type: string
default: v1
executors:
default-docker-executor:
docker:
- image: circleci/node:16.6.2-browsers
jobs:
setup-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- restore_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Installing dependencies
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- save_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ~/project/node_modules
- ~/.cache/Cypress
tests-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- restore_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Running tests
command: npm test
- store_artifacts:
path: coverage
build-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- restore_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Building project
command: npm run build
- persist_to_workspace:
root: .
paths:
- public
tests-e2e-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- restore_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
- attach_workspace:
at: .
- run:
name: Running e2e tests
command: npm run test:e2e
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
tests-visual-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- restore_cache:
key: << pipeline.parameters.dependency-cache-version >>-dependency-cache-{{ checksum "package-lock.json" }}
- attach_workspace:
at: .
- run:
name: Running visual tests
command: npm run test:visual
- run:
name: Compressing Artifacts
command: find . -name '__diff_output__' | tar -cvjf tests-visual-job-artifacts.tar.bz2 --files-from -
when: always
- store_artifacts:
path: tests-visual-job-artifacts.tar.bz2
deploy-job:
executor:
name: default-docker-executor
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Deploy to Netlify
command: npx netlify-cli deploy --prod --dir=public
workflows:
default-workflow:
jobs:
- setup-job
- tests-job:
requires:
- setup-job
- build-job:
requires:
- setup-job
- tests-job
- tests-e2e-job:
requires:
- setup-job
- tests-job
- build-job
- tests-visual-job:
requires:
- setup-job
- tests-job
- build-job
- deploy-job:
requires:
- setup-job
- tests-job
- build-job
- tests-e2e-job
- tests-visual-job
filters:
branches:
only: master