Skip to content

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt… #197

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt…

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt… #197

name: Python Test Suite
on:
push:
paths:
- .github/workflows/test_suite_python.yml
- bindings/python/pychecks/**
- bindings/python/tests/**
- bindings/python/conftest.py
- bindings/python/poetry.lock
- bindings/python/pyproject.toml
pull_request:
paths:
- .github/workflows/test_suite_python.yml
- bindings/python/pychecks/**
- bindings/python/tests/**
- bindings/python/conftest.py
- bindings/python/poetry.lock
- bindings/python/pyproject.toml
jobs:
test:
name: Python test
defaults:
run:
working-directory: bindings/python
shell: bash
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{matrix.python-version}}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ (matrix.python-version == '3.7') && '1.5.1' || 'latest' }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest --hypothesis-profile default --cov pychecks/ --cov-report=xml -n=auto tests/
- uses: codecov/codecov-action@v3
with:
files: coverage.xml
flags: lang-python