Skip to content

[pre-commit.ci] pre-commit autoupdate #754

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #754

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
code-quality:
name: Code quality
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print(*sys.version_info, sep='-')") >> $GITHUB_OUTPUT
- name: Install poetry
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: v1-venv-code-quality-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --extras=keyring --only=main,dev,lint
- name: Run lint task
env:
SKIP: no-commit-to-branch
run: poetry run task lint
tests:
name: ${{ matrix.os }} / ${{ matrix.python }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
exclude:
# skip pypy3 + win builds until https://github.com/python-poetry/poetry/issues/4626 is fixed
- os: windows
python: pypy-3.9
- os: windows
python: pypy-3.10
# reference: https://github.com/snok/install-poetry#running-on-windows
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print(*sys.version_info, sep='-')") >> $GITHUB_OUTPUT
- name: Install poetry
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: v1-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --extras=keyring --only=main,dev,test
- name: Bump package version
run: poetry version
- name: Run test task
run: poetry run task test --cov-report xml:coverage.xml --junitxml=unittests.xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
verbose: true