mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
The workflow triggers on pull requests that touch a board defconfig or the USB ID tooling, and checks only the defconfigs the PR adds or modifies. The file list comes from diffing the checked-out PR merge commit against its base parent, so no API call or token is needed. A PR that changes the tooling itself is checked against every board, so a checker change is proven on the real tree and not only by its unit tests. A test keeps the tooling list and the workflow paths filter in sync. A manual run checks every board. There is no push or scheduled run: the registry repo checks its own changes against PX4 main, and board changes reach main only through PRs. The mypy and flake8 step for the checker and runner lives in python_checks.yml with the other Python tooling checks. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Dronecode USB ID Registry
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
# Keep in sync with TOOLING in Tools/ci/usb_ids_runner.py
|
|
paths:
|
|
- 'boards/*/*/nuttx-config/*/defconfig'
|
|
- '.github/workflows/usb_ids.yml'
|
|
- 'Tools/ci/check_usb_ids.py'
|
|
- 'Tools/ci/test_check_usb_ids.py'
|
|
- 'Tools/ci/test_usb_ids_runner.py'
|
|
- 'Tools/ci/usb_ids_runner.py'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
name: Board USB VID/PID must be registered
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
# the PR merge commit and its base parent, to diff the PR locally
|
|
fetch-depth: 2
|
|
|
|
- name: Install PyYAML
|
|
run: pip install pyyaml --break-system-packages
|
|
|
|
- name: Test the USB ID checker and runner
|
|
working-directory: Tools/ci
|
|
run: python3 -m unittest -v test_check_usb_ids test_usb_ids_runner
|
|
|
|
- name: Check USB IDs against the Dronecode registry
|
|
run: python3 Tools/ci/usb_ids_runner.py
|