Skip to content

feat: Python bindings (PyO3) #220

feat: Python bindings (PyO3)

feat: Python bindings (PyO3) #220

Workflow file for this run

# ===============================================================
# CI - Rust lint, test, examples, and docs gate
# ===============================================================
name: CI
on:
push:
branches: ["main", "dev"]
pull_request:
types: [opened, synchronize, ready_for_review]
branches: ["main", "dev"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
lint:
name: Lint (fmt + clippy)
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Rust 1.96.0
uses: dtolnay/rust-toolchain@1.96.0
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --workspace --all-targets -- -D warnings
unused-deps:
name: Unused deps (advisory)
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 15
# Advisory only: cargo-machete static analysis false-positives on
# macro/derive-only crates (thiserror, tracing, serde, async-trait). Surfaced
# as a non-blocking signal until the reports are triaged in a follow-up.
continue-on-error: true
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install cargo-machete
run: cargo install cargo-machete --locked
- run: cargo machete
test:
name: Test (workspace)
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Rust 1.96.0
uses: dtolnay/rust-toolchain@1.96.0
- uses: Swatinem/rust-cache@v2
- name: cargo test
# Valkey/testcontainers integration tests are `#[ignore]`d by default
# and run out-of-band, so this needs no Docker daemon.
run: cargo test --workspace
examples:
name: Examples build (Rust + Go FFI)
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Rust 1.96.0
uses: dtolnay/rust-toolchain@1.96.0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.25.4"
- uses: Swatinem/rust-cache@v2
# Builds every Rust example plus the Go demo (which links the release
# cpex-ffi cdylib) — the cheapest guard against stale public-API usage.
- name: make examples-build
run: make examples-build
package:
name: Package (publish dry-run)
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Rust 1.96.0
uses: dtolnay/rust-toolchain@1.96.0
- uses: Swatinem/rust-cache@v2
# Continuous dry-run of the crates.io release: build + verify a .crate for
# every publishable member without uploading. Catches publishability
# regressions (missing version reqs, packaging-excluded files, broken
# inter-crate deps) on every push/PR, long before a release tag. Mirrors
# `make publish-dry` and the release workflow's dry-run. The two
# `publish = false` FFI crates are excluded (not part of the registry set).
- name: cargo package (no upload)
run: cargo package --workspace --locked --exclude cpex-ffi --exclude cpex-demo-ffi
docs:
name: Docs Build
uses: ./.github/workflows/docs-build.yaml