Files
PX4-Autopilot/.github/workflows/python_checks.yml
T
Ramon Roche f92f17dbc8 feat(ci): add the AI PR review workflow
pr-ai-review.yml runs the review when someone with write access comments
`!ai-review` on a PR (optionally with model= and effort=), or on manual
dispatch. A gate job checks the commenter's repository permission through
the API. The review job assumes an OIDC role that only this workflow on
main can use, and pr-review-poster.yml posts the result as a COMMENT
review, accepting this workflow's issue_comment and workflow_dispatch
runs; its pull_request path is unchanged. python_checks.yml runs the new
tests, mypy and flake8.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00

59 lines
1.6 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 AI review tooling and the PR review poster
working-directory: Tools/ci
run: |
mypy --strict -p ai_review
flake8 ai_review test_pr_review_poster.py
python3 -m unittest discover -s ai_review -t . -v
python3 -m unittest -v test_pr_review_poster
- 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