3
3
on : [push, pull_request]
4
4
5
5
env :
6
- CACHE_SEED : 1
6
+ PYTHON_VERSION : 3.8.2
7
7
NODE_VERSION : 14.4.0
8
8
9
9
jobs :
@@ -26,70 +26,64 @@ jobs:
26
26
27
27
- uses : actions/setup-python@v2
28
28
with :
29
- python-version : 3.8
29
+ python-version : ${{ env.PYTHON_VERSION }}
30
30
31
31
- name : Cache pip dependencies
32
32
uses : actions/cache@v2
33
33
env :
34
- cache-name : cache-pip-tests-warehouse-p
34
+ cache-name : warehouse- cache-pip
35
35
with :
36
- path : . /.cache/pip
37
- key : ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
36
+ path : ~ /.cache/pip
37
+ key : ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
38
38
restore-keys : |
39
- ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
40
- ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-
41
- ${{ runner.os }}-${{ env.CACHE_SEED }}-
39
+ ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
40
+ ${{ runner.os }}-${{ github.job }}-
42
41
${{ runner.os }}-
43
42
44
43
- name : Cache node version manager
45
44
uses : actions/cache@v2
46
45
env :
47
- cache-name : cache-nvm-dh
46
+ cache-name : warehouse- cache-nvm
48
47
with :
49
48
path : ~/.nvm/versions/
50
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
49
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
51
50
restore-keys : |
52
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
53
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-
54
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-
51
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
52
+ ${{ runner.os }}-build-${{ github.job }}-
55
53
${{ runner.os }}-build-
56
54
${{ runner.os }}-
57
55
58
56
- name : Cache node modules
59
57
uses : actions/cache@v2
60
58
env :
61
- cache-name : cache-npm-modules-dh
59
+ cache-name : warehouse- cache-npm-modules
62
60
with :
63
61
path : |
64
62
~/.npm
65
63
**/node_modules
66
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
64
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
67
65
restore-keys : |
68
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
69
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-
70
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-
66
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
67
+ ${{ runner.os }}-build-${{ github.job }}-
71
68
${{ runner.os }}-build-
72
69
${{ runner.os }}-
73
70
71
+ - uses : actions/setup-node@v1
72
+ with :
73
+ node-version : ${{ env.NODE_VERSION }}
74
+
74
75
- name : Install dependencies
75
76
run : sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config
76
77
77
78
- name : Install pip requirements
78
79
run : |
79
- mkdir ./.cache && mkdir ./.cache/pip
80
- chown -R $(whoami) ./.cache/pip
81
- pip install -U pip setuptools wheel --cache-dir ./.cache/pip
82
- pip install -r requirements/main.txt --cache-dir ./.cache/pip
83
- pip install -r requirements/tests.txt --cache-dir ./.cache/pip
84
- pip install -r requirements/deploy.txt --cache-dir ./.cache/pip
80
+ pip install -U pip setuptools wheel
81
+ pip install -r requirements/main.txt
82
+ pip install -r requirements/tests.txt
83
+ pip install -r requirements/deploy.txt
85
84
86
85
- name : Setup node
87
86
run : |
88
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
89
- export NVM_DIR="$HOME/.nvm"
90
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
91
- [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
92
- nvm install $NODE_VERSION
93
87
npm i -g npm
94
88
npm install -g gulp-cli
95
89
npm ci
99
93
python -m coverage run -m pytest --strict --postgresql-host localhost
100
94
python -m coverage html
101
95
python -m coverage report -m --fail-under 100
102
- env :
103
- # The hostname used to communicate with the PostgreSQL service container
104
- POSTGRES_HOST : localhost
105
- # The default PostgreSQL port
106
- POSTGRES_PORT : 5432
107
96
108
97
lint :
109
98
runs-on : ubuntu-latest
@@ -113,12 +102,42 @@ jobs:
113
102
114
103
- uses : actions/setup-python@v2
115
104
with :
116
- python-version : 3.8
105
+ python-version : ${{ env.PYTHON_VERSION }}
117
106
118
- - name : Lint
107
+ - name : Cache pip dependencies
108
+ uses : actions/cache@v2
109
+ env :
110
+ cache-name : warehouse-cache-pip
111
+ with :
112
+ path : ~/.cache/pip
113
+ key : ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
114
+ restore-keys : |
115
+ ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
116
+ ${{ runner.os }}-${{ github.job }}-
117
+ ${{ runner.os }}-
118
+
119
+ - name : Cache node modules
120
+ uses : actions/cache@v2
121
+ env :
122
+ cache-name : warehouse-cache-node-modules
123
+ with :
124
+ path : |
125
+ ~/.npm
126
+ **/node_modules
127
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
128
+ restore-keys : |
129
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
130
+ ${{ runner.os }}-build-${{ github.job }}-
131
+ ${{ runner.os }}-build-
132
+ ${{ runner.os }}-
133
+
134
+ - name : Dependency setup
119
135
run : |
136
+ npm install eslint --save-dev
120
137
sudo apt-get update && sudo apt-get install make
121
- make lint ACTIONS=true
138
+
139
+ - name : Lint
140
+ run : make lint ACTIONS=true
122
141
123
142
docs :
124
143
runs-on : ubuntu-latest
@@ -128,7 +147,7 @@ jobs:
128
147
129
148
- uses : actions/setup-python@v2
130
149
with :
131
- python-version : 3.8
150
+ python-version : ${{ env.PYTHON_VERSION }}
132
151
133
152
- name : Documentation
134
153
run : |
@@ -143,26 +162,20 @@ jobs:
143
162
144
163
- uses : actions/setup-python@v2
145
164
with :
146
- python-version : 3.8
165
+ python-version : ${{ env.PYTHON_VERSION }}
147
166
148
167
- name : Cache pip dependencies
149
168
uses : actions/cache@v2
150
169
env :
151
- cache-name : cache-pip-deps-warehouse-p
170
+ cache-name : warehouse- cache-pip
152
171
with :
153
172
path : ~/.cache/pip
154
- key : ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
173
+ key : ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
155
174
restore-keys : |
156
- ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
157
- ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-
158
- ${{ runner.os }}-${{ env.CACHE_SEED }}-
175
+ ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
176
+ ${{ runner.os }}-${{ github.job }}-
159
177
${{ runner.os }}-
160
178
161
- - name : Set cache permissions
162
- run : |
163
- mkdir ~/.cache && mkdir ~/.cache/pip
164
- chown -R $(whoami) ~/.cache/pip
165
-
166
179
- name : Check dependencies
167
180
run : |
168
181
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config
@@ -185,47 +198,51 @@ jobs:
185
198
186
199
- uses : actions/setup-python@v2
187
200
with :
188
- python-version : 3.8
201
+ python-version : ${{ env.PYTHON_VERSION }}
189
202
190
203
- name : Check translations
191
204
run : make translations
192
205
193
- static-lint :
194
- runs-on : ubuntu-latest
195
- steps :
196
- - name : Check out repository
197
- uses : actions/checkout@v2
198
-
199
- - name : Static Lint Check
200
- run : |
201
- npm install eslint --save-dev
202
- ./node_modules/.bin/eslint 'warehouse/static/js/**' '**.js' 'tests/frontend/**' --ignore-pattern 'warehouse/static/js/vendor/**'
203
- ./node_modules/.bin/sass-lint --verbose
204
-
205
206
static-tests :
206
207
runs-on : ubuntu-latest
207
208
steps :
208
209
- name : Check out repository
209
210
uses : actions/checkout@v2
210
211
212
+ - name : Cache node version manager
213
+ uses : actions/cache@v2
214
+ env :
215
+ cache-name : warehouse-cache-nvm
216
+ with :
217
+ path : ~/.nvm/versions/
218
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
219
+ restore-keys : |
220
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
221
+ ${{ runner.os }}-build-${{ github.job }}-
222
+ ${{ runner.os }}-build-
223
+ ${{ runner.os }}-
224
+
211
225
- name : Cache node modules
212
226
uses : actions/cache@v2
213
227
env :
214
- cache-name : cache-node -modules-static-dh
228
+ cache-name : warehouse- cache-npm -modules-static
215
229
with :
216
230
path : |
217
231
~/.npm
218
232
**/node_modules
219
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
233
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
220
234
restore-keys : |
221
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
222
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-
223
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-
235
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
236
+ ${{ runner.os }}-build-${{ github.job }}-
224
237
${{ runner.os }}-build-
225
238
${{ runner.os }}-
226
239
227
- - name : Dependency Setup
228
- run : npm install -D babel
240
+ - uses : actions/setup-node@v1
241
+ with :
242
+ node-version : ${{ env.NODE_VERSION }}
243
+
244
+ - name : Node dependency setup
245
+ run : npm ci
229
246
230
247
- name : Static Tests
231
248
run : bin/static_tests
@@ -239,35 +256,37 @@ jobs:
239
256
- name : Cache node version manager
240
257
uses : actions/cache@v2
241
258
env :
242
- cache-name : cache-nvm-pipeline-dh
259
+ cache-name : warehouse- cache-nvm
243
260
with :
244
261
path : ~/.nvm/versions/
245
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
262
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
246
263
restore-keys : |
247
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
248
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-
249
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-
264
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
265
+ ${{ runner.os }}-build-${{ github.job }}-
250
266
${{ runner.os }}-build-
251
267
${{ runner.os }}-
252
268
253
269
- name : Cache node modules
254
270
uses : actions/cache@v2
255
271
env :
256
- cache-name : cache-node -modules-static-dh
272
+ cache-name : warehouse- cache-npm -modules
257
273
with :
258
274
path : |
259
275
~/.npm
260
276
**/node_modules
261
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
277
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
262
278
restore-keys : |
263
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-
264
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-
265
- ${{ runner.os }}-build-${{ env.CACHE_SEED }}-
279
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
280
+ ${{ runner.os }}-build-${{ github.job }}-
266
281
${{ runner.os }}-build-
267
282
${{ runner.os }}-
268
283
269
- - name : Dependency Setup
270
- run : npm install -D babel
284
+ - uses : actions/setup-node@v1
285
+ with :
286
+ node-version : ${{ env.NODE_VERSION }}
287
+
288
+ - name : Node dependency setup
289
+ run : npm ci
271
290
272
291
- name : Static Pipeline Check
273
- run : bin/static_pipeline # this periodically fails for no reason, just rerun the job if needed
292
+ run : bin/static_pipeline
0 commit comments