Skip to content

Commit c6be21d

Browse files
committed
Adjust GitHub Actions CI/CD linters
* workflow vs job name * TOX_PARALLEL_NO_SPINNER * vendoring * env state logging * Pip cache
1 parent 5352539 commit c6be21d

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed
Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: Code quality
1+
name: >-
2+
🤖
3+
Code quality
24
35
on:
46
push:
@@ -10,24 +12,53 @@ on:
1012

1113
jobs:
1214
linters:
13-
name: 🤖
15+
name: >-
16+
${{ matrix.env.TOXENV }}
17+
/
18+
${{ matrix.python-version }}
19+
/
20+
${{ matrix.os }}
1421
runs-on: ${{ matrix.os }}
1522
strategy:
1623
# max-parallel: 5
1724
matrix:
25+
python-version:
26+
- 3.8
1827
os:
19-
- ubuntu-18.04
28+
- ubuntu-latest
2029
- windows-latest
2130
- macos-latest
2231
env:
2332
- TOXENV: docs
2433
- TOXENV: lint
34+
- TOXENV: vendoring
35+
36+
env:
37+
TOX_PARALLEL_NO_SPINNER: 1
38+
2539
steps:
2640
- uses: actions/checkout@master
27-
- name: Set up Python ${{ matrix.env.PYTHON_VERSION || 3.8 }}
41+
- name: Set up Python ${{ matrix.python-version }}
2842
uses: actions/setup-python@v1
2943
with:
30-
python-version: ${{ matrix.env.PYTHON_VERSION || 3.8 }}
44+
python-version: ${{ matrix.python-version }}
45+
- name: Log Python version
46+
run: >-
47+
python --version
48+
- name: Log Python location
49+
run: >-
50+
which python
51+
- name: Log Python env
52+
run: >-
53+
python -m sysconfig
54+
- name: Pip cache
55+
uses: actions/cache@v1
56+
with:
57+
path: ~/.cache/pip
58+
key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }}
59+
restore-keys: |
60+
${{ runner.os }}-pip-
61+
${{ runner.os }}-
3162
- name: set PY
3263
run: echo "::set-env name=PY::$(python -VV | sha256sum | cut -d' ' -f1)"
3364
- uses: actions/cache@v1
@@ -38,16 +69,33 @@ jobs:
3869
run: |
3970
git config --global user.email "pypa-dev@googlegroups.com"
4071
git config --global user.name "pip"
41-
- name: Update setuptools and tox dependencies
42-
run: |
72+
- name: Update setuptools
73+
run: >-
4374
python -m pip install --upgrade setuptools
75+
- name: Install tox
76+
run: >-
4477
python -m pip install --upgrade tox tox-venv
78+
- name: Log the list of packages
79+
run: >-
4580
python -m pip freeze --all
4681
- name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}'
4782
run: >-
48-
python -m tox --notest --skip-missing-interpreters false
83+
python -m
84+
tox
85+
--parallel auto
86+
--notest
87+
--skip-missing-interpreters false
4988
env: ${{ matrix.env }}
89+
- name: Pre-fetch pre-commit hooks
90+
# This is to separate test step from deps install
91+
if: matrix.env.TOXENV == 'lint'
92+
run: >-
93+
.tox/lint/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/python -m
94+
pre_commit
95+
install-hooks
5096
- name: Test with tox
5197
run: >-
52-
python -m tox
98+
python -m
99+
tox
100+
--parallel auto
53101
env: ${{ matrix.env }}

0 commit comments

Comments
 (0)