Skip to content

Add auto-detecting Python testing framework GitHub Action #12

Add auto-detecting Python testing framework GitHub Action

Add auto-detecting Python testing framework GitHub Action #12

name: Advanced Testing Example
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Python Tests
uses: thoughtparametersllc/python-testing@947908abd1dab777628becca5b772f26735e8146
with:
python-version: ${{ matrix.python-version }}
requirements-file: 'requirements-dev.txt'
pytest-options: '--cov=mypackage --cov-report=xml --cov-report=html'
unittest-options: '-v -s tests'
nose-options: '--verbose --with-coverage'
behave-options: '--format=progress --tags=@automated'
tox-options: '-e py${{ matrix.python-version }}'