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