Skip to content

👷 Add GitHub Actions workflow for running pytest #7

👷 Add GitHub Actions workflow for running pytest

👷 Add GitHub Actions workflow for running pytest #7

Workflow file for this run

name: Run Tests
on: ['pull_request']
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # Define OS you want to test
python-version: [3.8, 3.9, 3.10, 3.11] # Define Python versions you want to test
name: P${{ matrix.python-version }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then pip install .[dev]; fi
- name: Run tests
run: |
pytest --cov # Run pytest with coverage if needed