Skip to content

Commit db23013

Browse files
committed
Add linting dists via tox to GHA
1 parent 8601b49 commit db23013

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/test-library.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,79 @@ jobs:
4040
python setup.py install
4141
proxy --hostname 127.0.0.1 --enable-web-server --pid-file proxy.pid --log-file proxy.log &
4242
./tests/integration/main.sh
43+
44+
tox:
45+
name: ${{ matrix.toxenv }}
46+
47+
runs-on: Ubuntu-latest
48+
strategy:
49+
matrix:
50+
toxenv:
51+
- cleanup-dists,build-dists,metadata-validation
52+
fail-fast: false
53+
54+
env:
55+
PY_COLORS: 1
56+
TOX_PARALLEL_NO_SPINNER: 1
57+
TOXENV: ${{ matrix.toxenv }}
58+
59+
steps:
60+
- name: Switch to using Python v3.10
61+
uses: actions/setup-python@v2
62+
with:
63+
python-version: '3.10'
64+
- name: >-
65+
Calculate Python interpreter version hash value
66+
for use in the cache key
67+
id: calc-cache-key-py
68+
run: |
69+
from hashlib import sha512
70+
from sys import version
71+
72+
hash = sha512(version.encode()).hexdigest()
73+
print(f'::set-output name=py-hash-key::{hash}')
74+
shell: python
75+
- name: Get pip cache dir
76+
id: pip-cache
77+
run: >-
78+
echo "::set-output name=dir::$(pip cache dir)"
79+
- name: Set up pip cache
80+
uses: actions/[email protected]
81+
with:
82+
path: ${{ steps.pip-cache.outputs.dir }}
83+
key: >-
84+
${{ runner.os }}-pip-${{
85+
steps.calc-cache-key-py.outputs.py-hash-key }}-${{
86+
hashFiles('tox.ini') }}
87+
restore-keys: |
88+
${{ runner.os }}-pip-${{
89+
steps.calc-cache-key-py.outputs.py-hash-key
90+
}}-
91+
${{ runner.os }}-pip-
92+
- name: Install tox
93+
run: >-
94+
python -m
95+
pip install
96+
--user
97+
tox
98+
99+
- name: Grab the source from Git
100+
uses: actions/checkout@v2
101+
102+
- name: >-
103+
Pre-populate tox envs: `${{ env.TOXENV }}`
104+
run: >-
105+
python -m
106+
tox
107+
--parallel auto
108+
--parallel-live
109+
--skip-missing-interpreters false
110+
--notest
111+
- name: >-
112+
Run tox envs: `${{ env.TOXENV }}`
113+
run: >-
114+
python -m
115+
tox
116+
--parallel auto
117+
--parallel-live
118+
--skip-missing-interpreters false

0 commit comments

Comments
 (0)