Limit GitHub Actions workflow triggers to changes in .py files, requirements.txt, setup.py, or pyproject.toml to avoid unnecessary builds.
45 lines
780 B
YAML
45 lines
780 B
YAML
name: Python CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
- 'pyproject.toml'
|
|
- 'setup.py'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
- 'pyproject.toml'
|
|
- 'setup.py'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.13'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
pip install -e .
|
|
npm install -g pyright
|
|
|
|
- name: Run Pyright
|
|
run: pyright
|
|
|
|
- name: Run tests
|
|
run: |
|
|
pytest tests/
|