ci: add GitHub Actions workflows for PR checks and PyPI publishing

- pull_request.yml: lint (ruff) + test on PRs to master
- publish.yml: build and publish to PyPI on pushes to master
  (uses Trusted Publishing via PyPI publisher)
This commit is contained in:
Stevan Freeborn
2026-06-26 17:43:19 -05:00
parent 6774f42c2f
commit 208ad9114b
2 changed files with 60 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
name: Pull Request
on:
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup UV
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.13"
- name: Run uv sync
run: uv sync
- name: Run linter
run: uv run ruff check src/ tests/
- name: Run formatter
run: uv run ruff format --check src/ tests/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup UV
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Run uv sync
run: uv sync
- name: Load sandbox credentials
env:
SANDBOX_ENV: ${{ secrets.SANDBOX_ENV }}
run: printf '%s\n' "$SANDBOX_ENV" > .env
- name: Run tests
run: uv run pytest tests/ -q