Skip to content

chore(deps-dev): update ruff requirement in /sdk (#90) #149

chore(deps-dev): update ruff requirement in /sdk (#90)

chore(deps-dev): update ruff requirement in /sdk (#90) #149

Workflow file for this run

# CI pipeline for the OpenDecree Python SDK.
#
# Jobs: lint, typecheck, test (matrix: 3.11-3.13), examples → check (alls-green gate)
# The check job aggregates all results for branch protection.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install ruff
run: pip install ruff
- name: Check lint
run: ruff check sdk/src/ sdk/tests/
- name: Check formatting
run: ruff format --check sdk/src/ sdk/tests/
typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: sdk/pyproject.toml
- name: Install SDK with dev dependencies
run: pip install -e "sdk[dev]"
- name: Run mypy
run: cd sdk && mypy src/
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: sdk/pyproject.toml
- name: Install SDK with dev dependencies
run: pip install -e "sdk[dev]"
- name: Run tests with coverage
run: cd sdk && pytest --cov --cov-report=term-missing --cov-report=xml:coverage.xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
# codecov/codecov-action@v6.0.0
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2
with:
files: sdk/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
examples:
name: Examples
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: sdk/pyproject.toml
- name: Install SDK
run: pip install -e sdk/
- name: Compile-check all examples
run: |
python -m py_compile examples/quickstart/main.py
python -m py_compile examples/async-client/main.py
python -m py_compile examples/live-config/main.py
python -m py_compile examples/error-handling/main.py
python -m py_compile examples/setup.py
wheel-check:
name: Wheel contents
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build wheel
run: |
pip install build
python -m build sdk/ --wheel --outdir /tmp/dist
- name: Assert py.typed present
run: |
pip install zipfile36
python - <<'EOF'
import zipfile, glob, sys
wheels = glob.glob("/tmp/dist/*.whl")
assert wheels, "no wheel found"
with zipfile.ZipFile(wheels[0]) as whl:
names = whl.namelist()
found = [n for n in names if n.endswith("py.typed")]
if not found:
print("FAIL: py.typed missing from wheel"); print("\n".join(names)); sys.exit(1)
print(f"OK: {found[0]}")
EOF
check:
name: CI check
if: always()
needs: [lint, typecheck, test, examples, wheel-check]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}