-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
210 lines (186 loc) · 4.73 KB
/
circle.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
version: 2.1
executors:
builder:
docker:
- image: telus/build-essential
browsers:
docker:
- image: circleci/node:8-browsers
prepr:
docker:
- image: circleci/node:8
commands:
persist:
steps:
- persist_to_workspace:
root: .
paths: .
attach:
steps:
- attach_workspace:
at: .
expect:
steps:
- run: sudo apt-get update -y
- run: sudo apt-get install -y expect
install:
steps:
- run:
name: Install dependencies
command: npm ci
jobs:
build:
executor: builder
steps:
- checkout
- run:
name: Bootstrap
command: npm run bootstrap:ci
- persist
lint:
executor: builder
steps:
- attach
- run: npm run lint
unit:
executor: builder
steps:
- attach
- run: npm run test:lowmemory
e2e:
executor: browsers
steps:
- attach
- run:
name: Prepare node-sass
command: npm rebuild node-sass
- run:
name: Styleguidist Server
command: npm run dev:e2e-direct
background: true
- run: npm run test:e2e-direct -- -a
prepr-log:
executor: prepr
steps:
- attach
- expect
- run:
name: Package version bumps
command: scripts/prePr.sh
prepr-bot:
executor: prepr
steps:
- attach
- expect
- add_ssh_keys:
fingerprints:
- '16:04:2d:ed:15:8d:0b:56:ea:ee:82:6e:01:a4:5b:09'
- run:
name: Add Github Key
command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run:
name: Configure Git Config & Branch
command: |
git status
git config --global user.email "[email protected]"
git config --global user.name "TDSBot"
- run:
name: Rebase branch
command: |
git checkout master
git pull --rebase
- run:
name: TDS Bot output
command: if [ "$CI_PULL_REQUEST" != "" ]; then node ./scripts/circleci/github-pr.js; fi
release:
executor: builder
steps:
- attach
- add_ssh_keys:
fingerprints:
- '16:04:2d:ed:15:8d:0b:56:ea:ee:82:6e:01:a4:5b:09'
- run:
name: Add Github Key
command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run:
name: Configure Git Config & Branch
command: |
git status
git config --global user.email "[email protected]"
git config --global user.name "TDSBot"
git fetch origin --tags
- run:
name: Setup .npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- run:
name: Lerna Publish
command: npm run lerna:cipublish
screenshots:
executor: browsers
steps:
- attach
- add_ssh_keys:
fingerprints:
- '16:04:2d:ed:15:8d:0b:56:ea:ee:82:6e:01:a4:5b:09'
- run:
name: Add Github Key
command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run:
name: Configure Git Config & Branch
command: |
git status
git config --global user.email "[email protected]"
git config --global user.name "TDSBot"
git pull
- run:
name: Prepare node-sass
command: npm rebuild node-sass
- run:
name: Styleguidist Server
command: npm run dev:e2e-direct
background: true
- run:
name: Update Screenshots
command: npm run test:e2e-direct -- -a -u
- run:
name: Commit updated e2e screenshots
command: |
if [[ $(git diff --name-only) ]]
then git add e2e
git commit -m "test(e2e): update screenshots with version bump"
git push
else
echo 'No screenshot changes.'
fi
workflows:
version: 2
run:
jobs:
- build
- lint:
requires: [build]
- unit:
requires: [build]
- e2e:
requires: [build]
- prepr-bot:
requires: [build, lint, unit, e2e]
filters:
branches:
ignore: master
- prepr-log:
requires: [build, lint, unit, e2e]
filters:
branches:
only: master
- approve-release:
type: approval
requires: [build, lint, unit, e2e, prepr-log]
filters:
branches:
only: master
- release:
context: npm-library
requires: [approve-release]
- screenshots:
requires: [release]