Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

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@v3
with:
fetch-depth: 0 # clone fulle history so setuptools-scm can calculate the correct dev version
- name: Setup Python 3.9
uses: actions/setup-python@v4
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.3.3
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ 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.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.9']
exclude:
# skip pypy3 + win builds until https://github.com/python-poetry/poetry/issues/4626 is fixed
- os: windows
python: pypy-3.7
- os: windows
python: pypy-3.9
# reference: https://github.com/snok/install-poetry#running-on-windows
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
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.3.3
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v3
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 run task scm | xargs 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@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
verbose: true