Skip to content

Commit d56f00b

Browse files
committed
fix(ci): fine tune the testing matrix
- run the qa tools only once - test only one combination of isort/flake8 with all python versions - the whole matrix of isort/flake8 versions only with python 3.9
1 parent 8bfa8b5 commit d56f00b

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

.github/workflows/tests.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,31 @@ env:
88
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99
jobs:
1010
test:
11-
name: Python ${{ matrix.python-version }} x isort ${{ matrix.isort }} x flake8 ${{ matrix.flake8 }}
11+
name: py-${{ matrix.python-version }}/isort-${{ matrix.isort }}/flake8-${{ matrix.flake8 }}
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
python-version: ["3.10", 3.9, 3.8, 3.7, pypy-3.9]
16-
isort: [4.3.21, 5.10.1]
17-
flake8: [3.9.2, 4.0.1, 5.0.4]
16+
isort: [5.10.1]
17+
flake8: [5.0.4]
18+
include:
19+
- python-version: 3.9
20+
isort: 5.10.1
21+
flake8: 4.0.1
22+
qa: 'true'
23+
- python-version: 3.9
24+
isort: 5.10.1
25+
flake8: 3.9.2
26+
27+
- python-version: 3.9
28+
isort: 4.3.21
29+
flake8: 5.0.4
30+
- python-version: 3.9
31+
isort: 4.3.21
32+
flake8: 4.0.1
33+
- python-version: 3.9
34+
isort: 4.3.21
35+
flake8: 3.9.2
1836
steps:
1937
- uses: actions/checkout@v3
2038
- name: Set up Python
@@ -40,31 +58,31 @@ jobs:
4058
if: matrix.isort == '4.3.21'
4159
# formatters
4260
- name: Run pyupgrade
43-
if: matrix.python-version == '3.9'
61+
if: matrix.qa == 'true'
4462
run: pyupgrade --py37-plus *.py
4563
- name: Run isort
46-
if: matrix.python-version == '3.9'
64+
if: matrix.qa == 'true'
4765
run: isort --check-only *.py
4866
- name: Run black
49-
if: matrix.python-version == '3.9'
67+
if: matrix.qa == 'true'
5068
run: black --check --skip-string-normalization *.py
5169
# linters
5270
- name: Lint with bandit
53-
if: matrix.python-version == '3.9'
71+
if: matrix.qa == 'true'
5472
run: bandit --skip B101 *.py # B101 is assert statements
5573
- name: Lint with codespell
56-
if: matrix.python-version == '3.9'
74+
if: matrix.qa == 'true'
5775
run: codespell *.rst *.py
5876
- name: Lint with flake8
59-
if: matrix.python-version == '3.9'
77+
if: matrix.qa == 'true'
6078
run: flake8 *.py --count --max-complexity=18 --max-line-length=88 --show-source --statistics
6179
- name: Lint with mypy
62-
if: matrix.python-version == '3.9'
80+
if: matrix.qa == 'true'
6381
run: |
6482
mkdir --parents --verbose .mypy_cache
6583
mypy --ignore-missing-imports --install-types --non-interactive *.py || true
6684
- name: Lint with safety
67-
if: matrix.python-version == '3.9'
85+
if: matrix.qa == 'true'
6886
run: safety check || true
6987
# tests and coverage
7088
- name: Test

0 commit comments

Comments
 (0)