Skip to content

Commit

Permalink
Add linting dists via tox to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Nov 1, 2021
1 parent 6d7ced4 commit 49b2034
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,79 @@ jobs:
pip install .
proxy --hostname 127.0.0.1 --enable-web-server --pid-file proxy.pid --log-file proxy.log &
./tests/integration/main.sh
tox:
name: ${{ matrix.toxenv }}

runs-on: Ubuntu-latest
strategy:
matrix:
toxenv:
- cleanup-dists,build-dists,metadata-validation
fail-fast: false

env:
PY_COLORS: 1
TOX_PARALLEL_NO_SPINNER: 1
TOXENV: ${{ matrix.toxenv }}

steps:
- name: Switch to using Python v3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: >-
Calculate Python interpreter version hash value
for use in the cache key
id: calc-cache-key-py
run: |
from hashlib import sha512
from sys import version
hash = sha512(version.encode()).hexdigest()
print(f'::set-output name=py-hash-key::{hash}')
shell: python
- name: Get pip cache dir
id: pip-cache
run: >-
echo "::set-output name=dir::$(pip cache dir)"
- name: Set up pip cache
uses: actions/cache@v2.1.5
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: >-
${{ runner.os }}-pip-${{
steps.calc-cache-key-py.outputs.py-hash-key }}-${{
hashFiles('tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{
steps.calc-cache-key-py.outputs.py-hash-key
}}-
${{ runner.os }}-pip-
- name: Install tox
run: >-
python -m
pip install
--user
tox
- name: Grab the source from Git
uses: actions/checkout@v2

- name: >-
Pre-populate tox envs: `${{ env.TOXENV }}`
run: >-
python -m
tox
--parallel auto
--parallel-live
--skip-missing-interpreters false
--notest
- name: >-
Run tox envs: `${{ env.TOXENV }}`
run: >-
python -m
tox
--parallel auto
--parallel-live
--skip-missing-interpreters false

0 comments on commit 49b2034

Please sign in to comment.