A pull request ran the workflow twice on the same commit, once for the branch push and once for the PR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JPUZks9z3Pi5oxw9GQ9znt
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
# Two gates, neither of which needs a camera or a display: the dataflow still
|
|
# matches the typed contract in dora-node.yml, and the node's own 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:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- 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
|
|
|
|
test:
|
|
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
|
|
|
|
# --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 .
|
|
|
|
# CI=true is already set by the runner, which is what keeps the node from
|
|
# trying to open a window on a headless machine.
|
|
- run: uv run pytest -q
|