42 lines
947 B
YAML
42 lines
947 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
cache-dependency-path: requirements-test.txt
|
|
|
|
- name: Install test dependencies
|
|
run: python -m pip install --disable-pip-version-check -r requirements-test.txt
|
|
|
|
- name: Check Python syntax
|
|
run: |
|
|
python - <<'PY'
|
|
from pathlib import Path
|
|
|
|
files = list(Path(".").rglob("*.py"))
|
|
for path in files:
|
|
compile(path.read_text(encoding="utf-8"), str(path), "exec")
|
|
print(f"Parsed {len(files)} Python files")
|
|
PY
|
|
|
|
- name: Run tests
|
|
run: python -m pytest tests -q
|