diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7f17e0f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +# ============================================================================= +# SochDB Python SDK — Continuous Integration +# ============================================================================= +# +# Runs on every push to main and every pull request against main. Each matrix +# cell runs: +# +# - `ruff check` on the E9 / F63 / F7 rule sets (syntax + logic errors) +# - `python -m compileall` (per-Python-version syntax coverage) +# - `import sochdb` smoke test (guards against module-level breakage) +# +# We deliberately do NOT run the full pytest suite here: the tests exercise the +# embedded FFI path, which needs the pre-built Rust libraries from the +# sochdb/sochdb release page (see release.yml for how those are downloaded). +# Wiring that up is left to a follow-up CI PR. +# +# The matrix covers every Python version listed in pyproject.toml's classifiers +# (3.9 through 3.13). Ubuntu-only because, without native binaries, additional +# OSes add cost without signal. +# ============================================================================= + +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + python-matrix: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + + - name: Install SDK (editable) and dev dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[dev]" + + - name: Ruff — syntax and logic checks + run: | + ruff check \ + --select E9,F63,F7 \ + --exclude "src/sochdb/sochdb_pb2.py,src/sochdb/sochdb_pb2_grpc.py,src/sochdb/proto/*_pb2*.py" \ + src/ tests/ + + - name: Byte-compile source + run: python -m compileall -q src/sochdb + + - name: Import smoke test (native FFI is lazy — no binary needed) + run: | + python -c "import sochdb; print('sochdb', sochdb.__version__, 'core', sochdb.__core_version__)" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b6643a..cee7cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to the SochDB Python SDK will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- **CI workflow** (`.github/workflows/ci.yml`) — runs on every push to `main` + and every pull request against `main`, matrixed across Python 3.9–3.13. Each + cell runs `ruff check` on the `E9`/`F63`/`F7` rule sets, `python -m compileall` + for per-version syntax coverage, and an `import sochdb` smoke test. Does not + yet run the full pytest suite (that requires the pre-built Rust FFI libraries + from the `sochdb/sochdb` release page — follow-up CI PR). +- **CI status badge** in `README.md` linking to the workflow. +- **`ruff>=0.5`** added to the `[dev]` extras so `pip install -e ".[dev]"` + installs the same linter CI runs. + ## [0.8.1] - 2026-06-24 ### Changed diff --git a/README.md b/README.md index 4eb4a7e..464ab1c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # SochDB Python SDK +[![CI](https://github.com/sochdb/sochdb-python-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/sochdb/sochdb-python-sdk/actions/workflows/ci.yml) + **Dual-mode architecture: Embedded (FFI) + Server (gRPC/IPC)** Choose the deployment mode that fits your needs. diff --git a/pyproject.toml b/pyproject.toml index d0e4f43..0259abf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ dev = [ "pytest>=7.0", "pytest-cov>=4.0", "faker>=18.0", + "ruff>=0.5", ] all = [ "posthog>=3.0.0",