Skip to content

Commit 80e6d21

Browse files
authored
Python 3.11 is supported too (#22)
* Test against python 3.11 too * Only run lint once, not for every python version!
1 parent 30fa54f commit 80e6d21

File tree

1 file changed

+42
-13
lines changed

1 file changed

+42
-13
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,78 @@ env:
1111
PRE_COMMIT_COLOR: always
1212

1313
jobs:
14-
build:
14+
# We only need to lint once, not for _each_ python version
15+
lint:
1516
runs-on: ${{ matrix.os }}
1617
strategy:
1718
fail-fast: false
1819
matrix:
19-
python-version: ['3.7', '3.8', '3.9', '3.10']
20+
python-version: ['3.11']
2021
os: [ubuntu-latest]
2122
env:
2223
PYTHON: ${{ matrix.python-version }}
2324
steps:
2425
- uses: actions/checkout@v2
2526
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v4
2728
with:
2829
python-version: ${{ matrix.python-version }}
29-
- name: Cache deps
30-
uses: actions/cache@v2
30+
- name: Cache python deps
31+
uses: actions/cache@v3
3132
with:
3233
path: |
33-
~/.cache/pypoetry/
3434
~/.cache/pip/
35+
~/.cache/pypoetry/
3536
key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
3637
restore-keys: python${{ matrix.python-version }}-
37-
- name: Cache pre-commit deps
38-
uses: actions/cache@v2
38+
- name: Cache pre-commitdeps
39+
uses: actions/cache@v3
3940
with:
4041
path: |
4142
~/.cache/pre-commit/
42-
key: precommit-${{ hashFiles('.pre-commit-config.yaml') }}
43-
restore-keys: precommit-
43+
key: precommit-py${{ matrix.python-version }}-precommit-${{ hashFiles('poetry.lock', '.pre-commit-config.yaml') }}
44+
restore-keys: precommit-py${{ matrix.python-version }}-
4445
- name: Install dependencies
4546
run: |
4647
python -m pip install --upgrade pip
47-
python -m pip install --upgrade poetry pre-commit
48-
poetry install
48+
python -m pip install --upgrade pre-commit poetry
49+
poetry install --no-root
4950
- name: Lint
5051
run: |
5152
pre-commit run --all-files -v --show-diff-on-failure
52-
poetry run pytest --dead-fixtures --dup-fixtures --color=yes
5353
pre-commit gc
54+
build:
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
60+
os: [ubuntu-latest]
61+
env:
62+
PYTHON: ${{ matrix.python-version }}
63+
steps:
64+
- uses: actions/checkout@v2
65+
- name: Set up Python ${{ matrix.python-version }}
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: ${{ matrix.python-version }}
69+
- name: Cache deps
70+
uses: actions/cache@v3
71+
with:
72+
path: |
73+
~/.cache/pypoetry/
74+
~/.cache/pip/
75+
key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
76+
restore-keys: python${{ matrix.python-version }}-
77+
- name: Install dependencies
78+
run: |
79+
python -m pip install --upgrade pip
80+
python -m pip install --upgrade poetry
81+
poetry install
5482
- name: Test with pytest
5583
run: |
5684
make test args="--color=yes"
85+
poetry run pytest --dead-fixtures --dup-fixtures --color=yes
5786
- name: Upload coverage to Codecov
5887
uses: codecov/[email protected]
5988
with:

0 commit comments

Comments
 (0)