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,42 @@ 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-tests
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
+ id : nvm-cache
133
+ env :
134
+ cache-name : cache-nvm-tests
135
+ with :
136
+ path : ~/.nvm/versions/
137
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
138
+ restore-keys : |
139
+ ${{ runner.os }}-build-${{ env.cache-name }}-
140
+ ${{ runner.os }}-build-
141
+ ${{ runner.os }}-
142
+
143
+ - name : Cache node modules
144
+ uses : actions/cache@v2
145
+ env :
146
+ cache-name : cache-node-modules-tests
147
+ with :
148
+ path : ~/.npm
149
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
150
+ restore-keys : |
151
+ ${{ runner.os }}-build-${{ env.cache-name }}-
152
+ ${{ runner.os }}-build-
153
+ ${{ runner.os }}-
154
+
119
155
- name : Install dependencies
120
156
run : |
121
157
apt-get update && apt-get -y install make locales build-essential curl libpq-dev autoconf
@@ -128,16 +164,27 @@ jobs:
128
164
echo "LANG=en_US.UTF-8" > /etc/locale.conf
129
165
locale-gen en_US.UTF-8
130
166
131
- - name : Setup tests
167
+ - name : Install nvm
168
+ # if: steps.nvm-cache.outputs.cache-hit == false
169
+ run : curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
170
+
171
+ - name : Install node
132
172
run : |
133
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
134
173
export NVM_DIR="$HOME/.nvm"
135
174
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
136
175
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
137
176
nvm install $NODE_VERSION
138
- pip install -U pip setuptools wheel
139
- pip install -r requirements.txt
140
- pip install -r requirements/dev.txt
177
+
178
+ - name : Install pip requirements
179
+ run : |
180
+ mkdir ./.cache && mkdir ./.cache/pip
181
+ chown -R $(whoami) ./.cache/pip
182
+ pip install -U pip setuptools wheel --cache-dir ./.cache/pip
183
+ pip install -r requirements.txt --cache-dir ./.cache/pip
184
+ pip install -r requirements/dev.txt --cache-dir ./.cache/pip
185
+
186
+ - name : Setup node
187
+ run : |
141
188
npm i -g npm
142
189
npm install -g gulp-cli
143
190
npm ci
@@ -154,7 +201,7 @@ jobs:
154
201
POSTGRES_PORT : 5432
155
202
156
203
lint :
157
- needs : build
204
+ needs : build-dh
158
205
runs-on : ubuntu-latest
159
206
container : fmrcampos/docker-ci-cache:stage
160
207
steps :
@@ -171,7 +218,7 @@ jobs:
171
218
make lint ACTIONS=true
172
219
173
220
docs :
174
- needs : build
221
+ needs : build-dh
175
222
runs-on : ubuntu-latest
176
223
container : fmrcampos/docker-ci-cache:stage
177
224
steps :
@@ -184,24 +231,37 @@ jobs:
184
231
make docs
185
232
186
233
deps :
187
- needs : build
234
+ needs : build-dh
188
235
runs-on : ubuntu-latest
189
236
container : fmrcampos/docker-ci-cache:stage
190
237
steps :
191
238
- name : Check out repository
192
239
uses : actions/checkout@v2
193
240
241
+ - name : Cache pip dependencies
242
+ uses : actions/cache@v2
243
+ env :
244
+ cache-name : cache-pip-deps-deps
245
+ with :
246
+ path : ./.cache/pip
247
+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
248
+ restore-keys : |
249
+ ${{ runner.os }}-${{ env.cache-name }}-
250
+ ${{ runner.os }}-
251
+
194
252
- name : Dependencies
195
253
run : |
196
254
apt-get update && apt-get -y install build-essential make libpq-dev
197
255
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
256
+ mkdir ./.cache && mkdir ./.cache/pip
257
+ chown -R $(whoami) ./.cache/pip
258
+ pip install -U pip setuptools wheel --cache-dir ./.cache/pip
259
+ pip install -r requirements.txt --cache-dir ./.cache/pip
260
+ pip install -r requirements/dev.txt --cache-dir ./.cache/pip
201
261
make deps
202
262
203
263
licenses :
204
- needs : build
264
+ needs : build-dh
205
265
runs-on : ubuntu-latest
206
266
container : fmrcampos/docker-ci-cache:stage
207
267
steps :
@@ -212,7 +272,7 @@ jobs:
212
272
run : bin/licenses
213
273
214
274
translations :
215
- needs : build
275
+ needs : build-dh
216
276
runs-on : ubuntu-latest
217
277
container : fmrcampos/docker-ci-cache:stage
218
278
steps :
@@ -225,7 +285,7 @@ jobs:
225
285
make translations
226
286
227
287
static-lint :
228
- needs : build
288
+ needs : build-dh
229
289
runs-on : ubuntu-latest
230
290
container : fmrcampos/docker-ci-cache:static
231
291
steps :
@@ -239,13 +299,27 @@ jobs:
239
299
./node_modules/.bin/sass-lint --verbose
240
300
241
301
static-tests :
242
- needs : build
302
+ needs : build-dh
243
303
runs-on : ubuntu-latest
244
304
container : fmrcampos/docker-ci-cache:static
245
305
steps :
246
306
- name : Check out repository
247
307
uses : actions/checkout@v2
248
308
309
+ - name : Cache node modules
310
+ uses : actions/cache@v2
311
+ env :
312
+ cache-name : cache-node-modules-static
313
+ with :
314
+ path : |
315
+ ~/.npm
316
+ **/node_modules
317
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
318
+ restore-keys : |
319
+ ${{ runner.os }}-build-${{ env.cache-name }}-
320
+ ${{ runner.os }}-build-
321
+ ${{ runner.os }}-
322
+
249
323
- name : Static Tests
250
324
run : |
251
325
apt-get update && apt-get -y install locales
@@ -257,13 +331,39 @@ jobs:
257
331
bin/static_tests
258
332
259
333
static-pipeline :
260
- needs : build
334
+ needs : build-dh
261
335
runs-on : ubuntu-latest
262
336
container : fmrcampos/docker-ci-cache:static
263
337
steps :
264
338
- name : Check out repository
265
339
uses : actions/checkout@v2
266
340
341
+ - name : Cache node version manager
342
+ uses : actions/cache@v2
343
+ env :
344
+ cache-name : cache-nvm-pipeline
345
+ with :
346
+ path : ~/.nvm/versions/
347
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
348
+ restore-keys : |
349
+ ${{ runner.os }}-build-${{ env.cache-name }}-
350
+ ${{ runner.os }}-build-
351
+ ${{ runner.os }}-
352
+
353
+ - name : Cache node modules
354
+ uses : actions/cache@v2
355
+ env :
356
+ cache-name : cache-node-modules-static
357
+ with :
358
+ path : |
359
+ ~/.npm
360
+ **/node_modules
361
+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
362
+ restore-keys : |
363
+ ${{ runner.os }}-build-${{ env.cache-name }}-
364
+ ${{ runner.os }}-build-
365
+ ${{ runner.os }}-
366
+
267
367
- name : Locale & Dependency Setup
268
368
run : |
269
369
apt-get update && apt-get -y install locales
0 commit comments