From 208ad9114ba261d5ce9eccd4de064498908f22fb Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:43:19 -0500 Subject: [PATCH] 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) --- .github/workflows/publish.yml | 20 +++++++++++++++ .github/workflows/pull_request.yml | 40 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7f9f09d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,20 @@ +name: Publish +on: + push: + branches: [master] +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + id-token: write + 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 build + run: uv build + - name: Publish to PYPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..092852d --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -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