Skip to content

pytest

pytest #557

Workflow file for this run

name: pytest
on:
push:
paths:
- "src/**"
- "tests/**"
- "**/*.py"
- "!src/lpsim/env/**"
- "!src/lpsim/network/**"
pull_request:
paths:
- "src/**"
- "tests/**"
- "**/*.py"
- "!src/lpsim/env/**"
- "!src/lpsim/network/**"
workflow_dispatch:
workflow_call:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install -e ".[dev]"
- name: Create pyrightconfig.json
run: |
echo '{
"exclude": [
"src/lpsim/env/**"
],
"typeCheckingMode": "basic"
}' > pyrightconfig.json
- name: Run type check
run: |
pyright --version
pyright .
- name: Run tests with coverage
run: |
python -m setuptools_scm
python -m pytest --cov
coverage xml
- name: Upload coverage to Coveralls
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@v2