Skip to content

docs(export): fix ONNX Runtime example missing decode step (#1251) #3013

docs(export): fix ONNX Runtime example missing decode step (#1251)

docs(export): fix ONNX Runtime example missing decode step (#1251) #3013

Workflow file for this run

name: CPU tests Workflow
on:
push:
branches: ["main", "release/*", "develop"]
pull_request:
branches: ["main", "release/*", "develop"]
permissions:
contents: read
defaults:
run:
shell: bash
env:
# UV_TORCH_BACKEND only works with 'uv pip' commands, not 'uv sync'.
# Used by 'uv pip install torch torchvision' step to install CPU-only PyTorch.
UV_TORCH_BACKEND: "cpu"
concurrency:
group: pytest-test-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-pkg:
uses: ./.github/workflows/build-package.yml
run-tests:
name: Testing
# needs: build # todo: consider using this build package for testing
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- { os: "windows-latest", python-version: "3.10" }
- { os: "macos-latest", python-version: "3.10" }
- { os: "windows-latest", python-version: "3.13" }
- { os: "macos-latest", python-version: "3.13" }
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.9.26"
python-version: ${{ matrix.python-version }}
activate-environment: true
- name: 🚀 Install Packages
timeout-minutes: 5
# Install PyTorch CPU-only first (UV_TORCH_BACKEND=cpu works with 'uv pip').
# [coreml] added on macOS only (coremltools is a macOS-only dependency).
run: |
EXTRAS="train,augment,cli,visual"
if [ "${{ runner.os }}" = "macOS" ]; then
EXTRAS="$EXTRAS,coreml"
fi
uv pip install -e ".[$EXTRAS]" --group tests
- name: 🧪 Run the Test
run: |
uv run --no-sync pytest src/ tests/ \
-n 2 -m "not gpu and not coco17 and not e2e_coreml and not e2e_executorch" \
--ignore=tests/run_smoke_all_models.py \
--ignore=tests/legacy/test_checkpoint_compat.py \
--cov=rfdetr --cov-report=xml \
--timeout=420 \
--durations=50
- name: Upload coverage to Codecov
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "coverage.xml"
flags: cpu,${{ runner.os }},py${{ matrix.python-version }}
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
- name: Minimize uv cache
continue-on-error: true
run: uv cache prune --ci
testing-guardian:
runs-on: ubuntu-latest
needs: run-tests
if: always()
steps:
- name: 📋 Display test result
run: echo "${{ needs.run-tests.result }}"
- name: ❌ Fail guardian on test failure
if: needs.run-tests.result == 'failure'
run: exit 1
# Ensure that cancelled or skipped test runs still cause this guardian job to fail,
# using an explicit exit code instead of relying on timeout behavior.
- name: ⚠️ cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.run-tests.result)
run: |
echo "run-tests job result is '${{ needs.run-tests.result }}'; failing explicitly."
exit 1
- name: ✅ tests succeeded
if: needs.run-tests.result == 'success'
run: echo "All tests completed successfully in job 'run-tests'."