Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install
run: python -m pip install -e ".[dev]"

# `ruff format --check` is not enforced yet: the existing sources are not
# format-clean, and reformatting them belongs in its own PR.
- name: Ruff
run: ruff check .

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: Install
run: python -m pip install -e ".[dev]"

# pytest exits 5 when it collects no tests. main has no tests yet, so
# treat 5 as success until the first test file lands; every other
# non-zero code still fails the job.
- name: Pytest
run: |
set +e
pytest -q
code=$?
if [ "$code" -eq 5 ]; then
echo "::notice::pytest collected no tests (exit 5); treating as success."
exit 0
fi
exit "$code"
Loading