mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +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>
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Python CI Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}"]
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install tools
|
|
run: pip install mypy types-requests types-PyYAML flake8 pyyaml
|
|
|
|
- name: Check MAVSDK test scripts with mypy
|
|
run: mypy --strict test/mavsdk_tests/*.py
|
|
|
|
- name: Check MAVSDK test scripts with flake8
|
|
run: flake8 test/mavsdk_tests/*.py
|
|
|
|
- name: Check USB ID tooling with mypy and flake8
|
|
working-directory: Tools/ci
|
|
run: |
|
|
mypy --strict check_usb_ids.py usb_ids_runner.py test_check_usb_ids.py test_usb_ids_runner.py
|
|
flake8 check_usb_ids.py usb_ids_runner.py test_check_usb_ids.py test_usb_ids_runner.py
|
|
|
|
- name: Check ROS workspace tooling
|
|
run: |
|
|
flake8 Tools/ros2/*.py
|
|
python3 -m unittest discover -s Tools/ros2 -p 'test_*.py'
|
|
|
|
- name: Test submodule check
|
|
run: python3 -m unittest discover -s Tools -p 'test_check_submodules.py' -v
|