@@ -13,12 +13,12 @@ concurrency:
13
13
cancel-in-progress : true
14
14
15
15
jobs :
16
- build :
16
+ integration :
17
17
runs-on : ${{ matrix.os }}-latest
18
18
name : Library - Python ${{ matrix.python }} on ${{ matrix.os }}
19
19
strategy :
20
20
matrix :
21
- os : [macOS, ubuntu, windows ]
21
+ os : [macOS, Ubuntu ]
22
22
python : ['3.6', '3.7', '3.8', '3.9', '3.10']
23
23
max-parallel : 4
24
24
fail-fast : false
28
28
uses : actions/setup-python@v2
29
29
with :
30
30
python-version : ${{ matrix.python }}
31
- - name : Install dependencies
32
- run : |
33
- python -m pip install --upgrade pip
34
- pip install -r requirements.txt
35
- pip install -r requirements-testing.txt
36
- pip install -r requirements-tunnel.txt
37
- - name : Run Tests
38
- run : pytest --cov=proxy tests/
39
- - name : Upload coverage to Codecov
40
- env :
41
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
42
- run : codecov
43
31
- name : Integration testing
44
- if : matrix.os != 'windows'
45
32
run : |
33
+ pip install -U pip
46
34
pip install .
47
35
proxy \
48
36
--hostname 127.0.0.1 \
52
40
&
53
41
./tests/integration/main.sh
54
42
55
- tox :
43
+ lint :
56
44
name : ${{ matrix.toxenv }}
57
45
58
46
runs-on : Ubuntu-latest
@@ -129,10 +117,103 @@ jobs:
129
117
--parallel-live
130
118
--skip-missing-interpreters false
131
119
120
+ test :
121
+ name : 🐍${{ matrix.python }} @ ${{ matrix.os }}
122
+
123
+ runs-on : ${{ matrix.os }}-latest
124
+ strategy :
125
+ fail-fast : false
126
+ matrix :
127
+ os :
128
+ - macOS
129
+ - Ubuntu
130
+ - Windows
131
+ python :
132
+ # NOTE: The latest and the lowest supported Pythons are prioritized
133
+ # NOTE: to improve the responsiveness. It's nice to see the most
134
+ # NOTE: important results first.
135
+ - ' 3.10'
136
+ - 3.6
137
+ - 3.9
138
+ - 3.8
139
+ - 3.7
140
+ max-parallel : 4
141
+
142
+ env :
143
+ PY_COLORS : 1
144
+ TOX_PARALLEL_NO_SPINNER : 1
145
+ TOXENV : python
146
+
147
+ steps :
148
+ - name : Switch to using Python v${{ matrix.python }}
149
+ uses : actions/setup-python@v2
150
+ with :
151
+ python-version : ${{ matrix.python }}
152
+ - name : >-
153
+ Calculate Python interpreter version hash value
154
+ for use in the cache key
155
+ id: calc-cache-key-py
156
+ run: |
157
+ from hashlib import sha512
158
+ from sys import version
159
+
160
+ hash = sha512(version.encode()).hexdigest()
161
+ print(f'::set-output name=py-hash-key::{hash}')
162
+ shell: python
163
+ - name : Get pip cache dir
164
+ id : pip-cache
165
+ run : >-
166
+ echo "::set-output name=dir::$(pip cache dir)"
167
+ - name : Set up pip cache
168
+
169
+ with :
170
+ path : ${{ steps.pip-cache.outputs.dir }}
171
+ key : >-
172
+ ${{ runner.os }}-pip-${{
173
+ steps.calc-cache-key-py.outputs.py-hash-key }}-${{
174
+ hashFiles('tox.ini', 'requirements.txt', 'requirements-testing.txt')
175
+ }}
176
+ restore-keys : |
177
+ ${{ runner.os }}-pip-${{
178
+ steps.calc-cache-key-py.outputs.py-hash-key
179
+ }}-
180
+ ${{ runner.os }}-pip-
181
+ - name : Install tox
182
+ run : >-
183
+ python -m
184
+ pip install
185
+ --user
186
+ tox
187
+
188
+ - name : Grab the source from Git
189
+ uses : actions/checkout@v2
190
+
191
+ - name : Pre-populate the testing env
192
+ run : >-
193
+ python -m
194
+ tox
195
+ --parallel auto
196
+ --parallel-live
197
+ --skip-missing-interpreters false
198
+ --notest
199
+ - name : Run the testing
200
+ run : >-
201
+ python -m
202
+ tox
203
+ --parallel auto
204
+ --parallel-live
205
+ --skip-missing-interpreters false
206
+ - name : Upload coverage to Codecov
207
+ uses : codecov/codecov-action@v2
208
+ with :
209
+ flags : pytest, GHA, Python ${{ matrix.python }}, ${{ runner.os }}
210
+ verbose : true
211
+
132
212
check : # This job does nothing and is only used for the branch protection
133
213
needs :
134
- - build
135
- - tox
214
+ - integration
215
+ - lint
216
+ - test
136
217
137
218
runs-on : ubuntu-latest
138
219
0 commit comments