9
9
NODE_VERSION : 14.4.0
10
10
11
11
jobs :
12
- build :
12
+ build-dh :
13
13
name : Docker Hub Cache
14
14
runs-on : ubuntu-latest
15
15
steps :
@@ -101,7 +101,7 @@ jobs:
101
101
run : docker push $GPR_CACHE_IMAGE:stage
102
102
103
103
test :
104
- needs : build
104
+ needs : build-dh
105
105
runs-on : ubuntu-latest
106
106
container : fmrcampos/docker-ci-cache:stage
107
107
services :
@@ -116,6 +116,41 @@ jobs:
116
116
- name : Check out repository
117
117
uses : actions/checkout@v2
118
118
119
+ - name : Cache pip dependencies
120
+ uses : actions/cache@v2
121
+ env :
122
+ cache-name : cache-pip-deps
123
+ with :
124
+ path : ./.cache/pip
125
+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
126
+ restore-keys : |
127
+ ${{ runner.os }}-${{ env.cache-name }}-
128
+ ${{ runner.os }}-
129
+
130
+ - name : Cache node version manager
131
+ uses : actions/cache@v2
132
+ env :
133
+ cache-name : cache-nvm-tests
134
+ with :
135
+ path : ~/.nvm/versions/
136
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
137
+ restore-keys : |
138
+ ${{ runner.os }}-build-${{ env.cache-name }}-
139
+ ${{ runner.os }}-build-
140
+ ${{ runner.os }}-
141
+
142
+ - name : Cache node modules
143
+ uses : actions/cache@v2
144
+ env :
145
+ cache-name : cache-node-modules-tests
146
+ with :
147
+ path : ~/.npm
148
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
149
+ restore-keys : |
150
+ ${{ runner.os }}-build-${{ env.cache-name }}-
151
+ ${{ runner.os }}-build-
152
+ ${{ runner.os }}-
153
+
119
154
- name : Install dependencies
120
155
run : |
121
156
apt-get update && apt-get -y install make locales build-essential curl libpq-dev autoconf
@@ -128,16 +163,21 @@ jobs:
128
163
echo "LANG=en_US.UTF-8" > /etc/locale.conf
129
164
locale-gen en_US.UTF-8
130
165
131
- - name : Setup tests
166
+ - name : Install pip requirements
167
+ run : |
168
+ mkdir ./.cache && mkdir ./.cache/pip
169
+ chown -R $(whoami) ./.cache/pip
170
+ pip install -U pip setuptools wheel --cache-dir ./.cache/pip
171
+ pip install -r requirements.txt --cache-dir ./.cache/pip
172
+ pip install -r requirements/dev.txt --cache-dir ./.cache/pip
173
+
174
+ - name : Setup node
132
175
run : |
133
176
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
134
177
export NVM_DIR="$HOME/.nvm"
135
178
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
136
179
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
137
180
nvm install $NODE_VERSION
138
- pip install -U pip setuptools wheel
139
- pip install -r requirements.txt
140
- pip install -r requirements/dev.txt
141
181
npm i -g npm
142
182
npm install -g gulp-cli
143
183
npm ci
@@ -154,7 +194,7 @@ jobs:
154
194
POSTGRES_PORT : 5432
155
195
156
196
lint :
157
- needs : build
197
+ needs : build-dh
158
198
runs-on : ubuntu-latest
159
199
container : fmrcampos/docker-ci-cache:stage
160
200
steps :
@@ -171,7 +211,7 @@ jobs:
171
211
make lint ACTIONS=true
172
212
173
213
docs :
174
- needs : build
214
+ needs : build-dh
175
215
runs-on : ubuntu-latest
176
216
container : fmrcampos/docker-ci-cache:stage
177
217
steps :
@@ -184,86 +224,143 @@ jobs:
184
224
make docs
185
225
186
226
deps :
187
- needs : build
227
+ needs : build-dh
188
228
runs-on : ubuntu-latest
189
229
container : fmrcampos/docker-ci-cache:stage
190
230
steps :
191
231
- name : Check out repository
192
232
uses : actions/checkout@v2
193
233
194
- - name : Dependencies
234
+ - name : Cache pip dependencies
235
+ uses : actions/cache@v2
236
+ env :
237
+ cache-name : cache-pip-deps
238
+ with :
239
+ path : ./.cache/pip
240
+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
241
+ restore-keys : |
242
+ ${{ runner.os }}-${{ env.cache-name }}-
243
+ ${{ runner.os }}-
244
+
245
+ - name : Install dependencies
195
246
run : |
196
247
apt-get update && apt-get -y install build-essential make libpq-dev
197
248
apt -y install libcurl4-openssl-dev libssl-dev pkg-config
198
- pip install -U pip setuptools wheel
199
- pip install -r requirements.txt
200
- pip install -r requirements/dev.txt # this is probably happening twice
201
- make deps
249
+ mkdir ./.cache && mkdir ./.cache/pip
250
+ chown -R $(whoami) ./.cache/pip
251
+ pip install -U pip setuptools wheel --cache-dir ./.cache/pip
252
+ pip install -r requirements.txt --cache-dir ./.cache/pip
253
+ pip install -r requirements/dev.txt --cache-dir ./.cache/pip
254
+
255
+ - name : Check dependencies
256
+ run : make deps
202
257
203
258
licenses :
204
- needs : build
259
+ needs : build-dh
205
260
runs-on : ubuntu-latest
206
261
container : fmrcampos/docker-ci-cache:stage
207
262
steps :
208
263
- name : Check out repository
209
264
uses : actions/checkout@v2
210
265
211
- - name : Licenses
266
+ - name : Check licenses
212
267
run : bin/licenses
213
268
214
269
translations :
215
- needs : build
270
+ needs : build-dh
216
271
runs-on : ubuntu-latest
217
272
container : fmrcampos/docker-ci-cache:stage
218
273
steps :
219
274
- name : Check out repository
220
275
uses : actions/checkout@v2
221
276
222
- - name : Translations
277
+ - name : Check translations
223
278
run : |
224
279
apt-get update && apt-get -y install make
225
280
make translations
226
281
227
282
static-lint :
228
- needs : build
283
+ needs : build-dh
229
284
runs-on : ubuntu-latest
230
285
container : fmrcampos/docker-ci-cache:static
231
286
steps :
232
287
- name : Check out repository
233
288
uses : actions/checkout@v2
234
289
235
- - name : Lint
290
+ - name : Static Lint Check
236
291
run : |
237
292
npm install eslint --save-dev
238
293
./node_modules/.bin/eslint 'warehouse/static/js/**' '**.js' 'tests/frontend/**' --ignore-pattern 'warehouse/static/js/vendor/**'
239
294
./node_modules/.bin/sass-lint --verbose
240
295
241
296
static-tests :
242
- needs : build
297
+ needs : build-dh
243
298
runs-on : ubuntu-latest
244
299
container : fmrcampos/docker-ci-cache:static
245
300
steps :
246
301
- name : Check out repository
247
302
uses : actions/checkout@v2
248
303
249
- - name : Static Tests
304
+ - name : Cache node modules
305
+ uses : actions/cache@v2
306
+ env :
307
+ cache-name : cache-node-modules-static
308
+ with :
309
+ path : |
310
+ ~/.npm
311
+ **/node_modules
312
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
313
+ restore-keys : |
314
+ ${{ runner.os }}-build-${{ env.cache-name }}-
315
+ ${{ runner.os }}-build-
316
+ ${{ runner.os }}-
317
+
318
+ - name : Locale & Dependency Setup
250
319
run : |
251
320
apt-get update && apt-get -y install locales
252
321
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
253
322
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
254
323
echo "LANG=en_US.UTF-8" > /etc/locale.conf
255
324
locale-gen en_US.UTF-8
256
325
npm install -D babel
257
- bin/static_tests
326
+
327
+ - name : Static Tests
328
+ run : bin/static_tests
258
329
259
330
static-pipeline :
260
- needs : build
331
+ needs : build-dh
261
332
runs-on : ubuntu-latest
262
333
container : fmrcampos/docker-ci-cache:static
263
334
steps :
264
335
- name : Check out repository
265
336
uses : actions/checkout@v2
266
337
338
+ - name : Cache node version manager
339
+ uses : actions/cache@v2
340
+ env :
341
+ cache-name : cache-nvm-pipeline
342
+ with :
343
+ path : ~/.nvm/versions/
344
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
345
+ restore-keys : |
346
+ ${{ runner.os }}-build-${{ env.cache-name }}-
347
+ ${{ runner.os }}-build-
348
+ ${{ runner.os }}-
349
+
350
+ - name : Cache node modules
351
+ uses : actions/cache@v2
352
+ env :
353
+ cache-name : cache-node-modules-static
354
+ with :
355
+ path : |
356
+ ~/.npm
357
+ **/node_modules
358
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
359
+ restore-keys : |
360
+ ${{ runner.os }}-build-${{ env.cache-name }}-
361
+ ${{ runner.os }}-build-
362
+ ${{ runner.os }}-
363
+
267
364
- name : Locale & Dependency Setup
268
365
run : |
269
366
apt-get update && apt-get -y install locales
0 commit comments