Skip to content

Commit

Permalink
Python 3.11 is supported too (#22)
Browse files Browse the repository at this point in the history
* Test against python 3.11 too

* Only run lint once, not for every python version!
  • Loading branch information
ashb committed Nov 10, 2022
1 parent 30fa54f commit 80e6d21
Showing 1 changed file with 42 additions and 13 deletions.
55 changes: 42 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,78 @@ env:
PRE_COMMIT_COLOR: always

jobs:
build:
# We only need to lint once, not for _each_ python version
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.11']
os: [ubuntu-latest]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache deps
uses: actions/cache@v2
- name: Cache python deps
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry/
~/.cache/pip/
~/.cache/pypoetry/
key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: python${{ matrix.python-version }}-
- name: Cache pre-commit deps
uses: actions/cache@v2
- name: Cache pre-commitdeps
uses: actions/cache@v3
with:
path: |
~/.cache/pre-commit/
key: precommit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: precommit-
key: precommit-py${{ matrix.python-version }}-precommit-${{ hashFiles('poetry.lock', '.pre-commit-config.yaml') }}
restore-keys: precommit-py${{ matrix.python-version }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry pre-commit
poetry install
python -m pip install --upgrade pre-commit poetry
poetry install --no-root
- name: Lint
run: |
pre-commit run --all-files -v --show-diff-on-failure
poetry run pytest --dead-fixtures --dup-fixtures --color=yes
pre-commit gc
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache deps
uses: actions/cache@v3
with:
path: |
~/.cache/pypoetry/
~/.cache/pip/
key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: python${{ matrix.python-version }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry install
- name: Test with pytest
run: |
make test args="--color=yes"
poetry run pytest --dead-fixtures --dup-fixtures --color=yes
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.5.0
with:
Expand Down

0 comments on commit 80e6d21

Please sign in to comment.