1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Adjust GitHub Actions CI/CD linters

* workflow vs job name
* TOX_PARALLEL_NO_SPINNER
* vendoring
* env state logging
* Pip cache
This commit is contained in:
Sviatoslav Sydorenko 2020-01-18 18:58:03 +01:00
parent e8cc348816
commit b662f76ac7
No known key found for this signature in database
GPG key ID: 9345E8FEA89CA455

View file

@ -1,4 +1,6 @@
name: Code quality
name: >-
🤖
Code quality
on:
push:
@ -10,24 +12,53 @@ on:
jobs:
linters:
name: 🤖
name: >-
${{ matrix.env.TOXENV }}
/
${{ matrix.python-version }}
/
${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# max-parallel: 5
matrix:
python-version:
- 3.8
os:
- ubuntu-18.04
- ubuntu-latest
- windows-latest
- macos-latest
env:
- TOXENV: docs
- TOXENV: lint
- TOXENV: vendoring
env:
TOX_PARALLEL_NO_SPINNER: 1
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.env.PYTHON_VERSION || 3.8 }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.env.PYTHON_VERSION || 3.8 }}
python-version: ${{ matrix.python-version }}
- name: Log Python version
run: >-
python --version
- name: Log Python location
run: >-
which python
- name: Log Python env
run: >-
python -m sysconfig
- name: Pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: set PY
run: echo "::set-env name=PY::$(python -VV | sha256sum | cut -d' ' -f1)"
- uses: actions/cache@v1
@ -38,16 +69,33 @@ jobs:
run: |
git config --global user.email "pypa-dev@googlegroups.com"
git config --global user.name "pip"
- name: Update setuptools and tox dependencies
run: |
- name: Update setuptools
run: >-
python -m pip install --upgrade setuptools
- name: Install tox
run: >-
python -m pip install --upgrade tox tox-venv
- name: Log the list of packages
run: >-
python -m pip freeze --all
- name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}'
run: >-
python -m tox --notest --skip-missing-interpreters false
python -m
tox
--parallel auto
--notest
--skip-missing-interpreters false
env: ${{ matrix.env }}
- name: Pre-fetch pre-commit hooks
# This is to separate test step from deps install
if: matrix.env.TOXENV == 'lint'
run: >-
.tox/lint/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/python -m
pre_commit
install-hooks
- name: Test with tox
run: >-
python -m tox
python -m
tox
--parallel auto
env: ${{ matrix.env }}