Files
dora-image-view/.gitea/workflows/validate.yml
T
cristhianandClaude Opus 5 22bd1e9e89
validate / dataflow (pull_request) Failing after 59m9s
validate / test (pull_request) Successful in 59m8s
add an in-repo synthetic source so the example needs no network
The example dataflow pulled opencv-video-capture and pyarrow-sender from
dora-hub, needed a webcam, and left `bbox` unwired because every bbox source
is a detector. examples/source.py emits an animated frame, the box around the
square in it, and a caption, so the dataflow exercises all three inputs with
nothing outside this checkout.

SOURCE_FRAMES bounds the run, which lets CI run the dataflow headless rather
than only validate it. Drops the dora-zed and dora-yolo wirings from the
README and trims AGENTS.md to what the code and README do not already say.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WLVZCFFcCH1EpTXGfS9aD
2026-09-14 16:09:01 -05:00

81 lines
2.5 KiB
YAML

# Two gates, neither of which needs a camera or a display: the example dataflow
# still matches the typed contract in dora-node.yml and still runs end to end,
# and the node's own unit tests pass.
name: validate
# A pull request would otherwise run this twice on the same commit: once for
# the branch push and once for the PR.
on:
push:
branches: [main]
pull_request:
env:
DORA_VERSION: v1.0.1
DORA_TARGET: x86_64-unknown-linux-gnu
jobs:
dataflow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The opencv-python wheel links against libGL at import time, so cv2
# cannot even be imported on the bare runner image.
- name: Install the OpenCV shared libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install the dora CLI
run: |
curl -fsSL -o dora-cli.tar.gz \
"https://github.com/dora-rs/dora/releases/download/${DORA_VERSION}/dora-cli-${DORA_TARGET}.tar.gz"
tar xzf dora-cli.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 755 "dora-cli-${DORA_TARGET}/dora" "$HOME/.local/bin/dora"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
rm -rf dora-cli.tar.gz "dora-cli-${DORA_TARGET}"
- run: dora --version
# strict_types: true in the dataflow turns a type warning into a non-zero
# exit, so a mismatched annotation fails here rather than at runtime.
- name: Validate the dataflow
run: dora validate dataflow.yml
# CI=true is already set by the runner, which keeps the viewer from trying
# to open a window; SOURCE_FRAMES bounds the source so the run ends on its
# own. Everything the dataflow needs is in the checkout.
- name: Run the dataflow headless
env:
SOURCE_FRAMES: 30
run: dora run dataflow.yml --uv
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the OpenCV shared libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
# --locked fails if uv.lock is out of date with pyproject.toml, so a
# dependency change that was never locked cannot reach main.
- name: Install
run: uv sync --locked --group dev
- run: uv run ruff check .
- run: uv run pytest -q