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,48 +26,45 @@ 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
@@ -76,34 +73,12 @@ jobs:
76
73
77
74
- name : Install pip requirements
78
75
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
85
-
86
- - name : Setup node
87
- 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
- npm i -g npm
94
- npm install -g gulp-cli
95
- npm ci
76
+ pip install -U pip setuptools wheel
77
+ pip install -r requirements/main.txt
78
+ pip install -r requirements/tests.txt
96
79
97
80
- name : Run tests
98
- run : |
99
- python -m coverage run -m pytest --strict --postgresql-host localhost
100
- python -m coverage html
101
- 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
81
+ run : bin/tests --postgresql-host localhost
107
82
108
83
lint :
109
84
runs-on : ubuntu-latest
@@ -113,12 +88,42 @@ jobs:
113
88
114
89
- uses : actions/setup-python@v2
115
90
with :
116
- python-version : 3.8
91
+ python-version : ${{ env.PYTHON_VERSION }}
117
92
118
- - name : Lint
93
+ - name : Cache pip dependencies
94
+ uses : actions/cache@v2
95
+ env :
96
+ cache-name : warehouse-cache-pip
97
+ with :
98
+ path : ~/.cache/pip
99
+ key : ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
100
+ restore-keys : |
101
+ ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
102
+ ${{ runner.os }}-${{ github.job }}-
103
+ ${{ runner.os }}-
104
+
105
+ - name : Cache node modules
106
+ uses : actions/cache@v2
107
+ env :
108
+ cache-name : warehouse-cache-node-modules
109
+ with :
110
+ path : |
111
+ ~/.npm
112
+ **/node_modules
113
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
114
+ restore-keys : |
115
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
116
+ ${{ runner.os }}-build-${{ github.job }}-
117
+ ${{ runner.os }}-build-
118
+ ${{ runner.os }}-
119
+
120
+ - name : Dependency setup
119
121
run : |
122
+ npm install eslint --save-dev
120
123
sudo apt-get update && sudo apt-get install make
121
- make lint ACTIONS=true
124
+
125
+ - name : Lint
126
+ run : make lint ACTIONS=true
122
127
123
128
docs :
124
129
runs-on : ubuntu-latest
@@ -128,7 +133,7 @@ jobs:
128
133
129
134
- uses : actions/setup-python@v2
130
135
with :
131
- python-version : 3.8
136
+ python-version : ${{ env.PYTHON_VERSION }}
132
137
133
138
- name : Documentation
134
139
run : |
@@ -143,26 +148,20 @@ jobs:
143
148
144
149
- uses : actions/setup-python@v2
145
150
with :
146
- python-version : 3.8
151
+ python-version : ${{ env.PYTHON_VERSION }}
147
152
148
153
- name : Cache pip dependencies
149
154
uses : actions/cache@v2
150
155
env :
151
- cache-name : cache-pip-deps-warehouse-p
156
+ cache-name : warehouse- cache-pip
152
157
with :
153
158
path : ~/.cache/pip
154
- key : ${{ runner.os }}-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
159
+ key : ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt') }}
155
160
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 }}-
161
+ ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
162
+ ${{ runner.os }}-${{ github.job }}-
159
163
${{ runner.os }}-
160
164
161
- - name : Set cache permissions
162
- run : |
163
- mkdir ~/.cache && mkdir ~/.cache/pip
164
- chown -R $(whoami) ~/.cache/pip
165
-
166
165
- name : Check dependencies
167
166
run : |
168
167
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config
@@ -185,47 +184,51 @@ jobs:
185
184
186
185
- uses : actions/setup-python@v2
187
186
with :
188
- python-version : 3.8
187
+ python-version : ${{ env.PYTHON_VERSION }}
189
188
190
189
- name : Check translations
191
190
run : make translations
192
191
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
192
static-tests :
206
193
runs-on : ubuntu-latest
207
194
steps :
208
195
- name : Check out repository
209
196
uses : actions/checkout@v2
210
197
198
+ - name : Cache node version manager
199
+ uses : actions/cache@v2
200
+ env :
201
+ cache-name : warehouse-cache-nvm
202
+ with :
203
+ path : ~/.nvm/versions/
204
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
205
+ restore-keys : |
206
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
207
+ ${{ runner.os }}-build-${{ github.job }}-
208
+ ${{ runner.os }}-build-
209
+ ${{ runner.os }}-
210
+
211
211
- name : Cache node modules
212
212
uses : actions/cache@v2
213
213
env :
214
- cache-name : cache-node -modules-static-dh
214
+ cache-name : warehouse- cache-npm -modules-static
215
215
with :
216
216
path : |
217
217
~/.npm
218
218
**/node_modules
219
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
219
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
220
220
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 }}-
221
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
222
+ ${{ runner.os }}-build-${{ github.job }}-
224
223
${{ runner.os }}-build-
225
224
${{ runner.os }}-
226
225
227
- - name : Dependency Setup
228
- run : npm install -D babel
226
+ - uses : actions/setup-node@v1
227
+ with :
228
+ node-version : ${{ env.NODE_VERSION }}
229
+
230
+ - name : Node dependency setup
231
+ run : npm ci
229
232
230
233
- name : Static Tests
231
234
run : bin/static_tests
@@ -239,35 +242,37 @@ jobs:
239
242
- name : Cache node version manager
240
243
uses : actions/cache@v2
241
244
env :
242
- cache-name : cache-nvm-pipeline-dh
245
+ cache-name : warehouse- cache-nvm
243
246
with :
244
247
path : ~/.nvm/versions/
245
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
248
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
246
249
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 }}-
250
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
251
+ ${{ runner.os }}-build-${{ github.job }}-
250
252
${{ runner.os }}-build-
251
253
${{ runner.os }}-
252
254
253
255
- name : Cache node modules
254
256
uses : actions/cache@v2
255
257
env :
256
- cache-name : cache-node -modules-static-dh
258
+ cache-name : warehouse- cache-npm -modules
257
259
with :
258
260
path : |
259
261
~/.npm
260
262
**/node_modules
261
- key : ${{ runner.os }}-build-${{ env.CACHE_SEED }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
263
+ key : ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
262
264
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 }}-
265
+ ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
266
+ ${{ runner.os }}-build-${{ github.job }}-
266
267
${{ runner.os }}-build-
267
268
${{ runner.os }}-
268
269
269
- - name : Dependency Setup
270
- run : npm install -D babel
270
+ - uses : actions/setup-node@v1
271
+ with :
272
+ node-version : ${{ env.NODE_VERSION }}
273
+
274
+ - name : Node dependency setup
275
+ run : npm ci
271
276
272
277
- name : Static Pipeline Check
273
- run : bin/static_pipeline # this periodically fails for no reason, just rerun the job if needed
278
+ run : bin/static_pipeline
0 commit comments