Skip to content

docs: move the supported-Python-versions badge to the Python READMEs #14

docs: move the supported-Python-versions badge to the Python READMEs

docs: move the supported-Python-versions badge to the Python READMEs #14

name: test.python-legacy
on:
workflow_call:
push:
paths:
- "legacy/wingfoil-python/**"
# Self-reference, as legacy-augurs-integration.yml already does: a change to
# this file must re-run the job it defines. Without it the coverage
# break below went unnoticed from b52c3f15 until the next commit that
# happened to touch the binding tree.
- ".github/workflows/legacy-python-test.yml"
workflow_dispatch:
# One in-flight run per ref. Superseded PR pushes are cancelled; pushes to
# main/next are not, so every merged commit keeps a status of its own. The
# group name is a literal, not ${{ github.workflow }}: when this workflow is
# reached through `workflow_call` that expression resolves to the *caller's*
# name, which would make every reusable leg share one group and cancel its
# siblings.
concurrency:
group: legacy-python-test-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
test:
name: Python Tests (legacy)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: llvm-tools-preview
- name: Cache Rust Build Artifacts
uses: Swatinem/rust-cache@v2
with:
# Legacy is its own workspace, so its artifacts land in
# `legacy/target` (cutover-plan 5.0).
workspaces: legacy
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install system dependencies
run: sudo apt-get install -y protobuf-compiler patchelf
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: legacy/wingfoil-python/pyproject.toml
- name: Create virtualenv and install dependencies
run: |
python -m venv legacy/wingfoil-python/.venv
legacy/wingfoil-python/.venv/bin/pip install maturin pytest pandas pyzmq pytest-cov pytest-timeout
- name: Build and test Python bindings with Rust coverage
run: |
# `show-env` has no --manifest-path; it reads the *current
# directory's* workspace to decide where instrumented objects and
# .profraw files go. Run it from the repo root and it points at the
# root `target/`, while the maturin build below writes into
# `legacy/target/` — the report step then finds no object files.
# So resolve the env inside the legacy workspace (cutover-plan 5.0).
cd legacy
source <(cargo llvm-cov show-env --export-prefix)
cd "$GITHUB_WORKSPACE/legacy/wingfoil-python"
.venv/bin/maturin develop
.venv/bin/pytest tests/ -v \
--timeout=120 \
--cov=wingfoil \
--cov-report=lcov:lcov-python.info
# Back to the repo root, not `legacy/` — `--output-path` below is
# workspace-relative. Named explicitly so a future move cannot
# silently re-point it the way `cd ..` did.
cd "$GITHUB_WORKSPACE"
cargo llvm-cov report --manifest-path legacy/Cargo.toml -p wingfoil-python \
--ignore-filename-regex 'py_etcd|py_kdb|py_zmq|py_iceoryx2' \
--lcov \
--output-path legacy/wingfoil-python/lcov-rust.info
- name: Upload Python coverage to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
files: legacy/wingfoil-python/lcov-python.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: python
fail_ci_if_error: false
- name: Upload Rust-from-Python coverage to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
files: legacy/wingfoil-python/lcov-rust.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-rust
fail_ci_if_error: false