Files
PX4-Autopilot/.github/workflows/python_checks.yml
T
Ramon Roche 40fee1673f ci(commit_checks): accept a backport tag in release branch PR titles
Backport PRs are titled "[BACKPORT 1.18] fix(mavlink): ...". The PR title
check anchors on the conventional commit type, so it fails all of them
even though the header after the tag is valid. Replaying the check over
the 210 PRs opened against release/1.16, release/1.17 and release/1.18,
62 fail only because of the tag.

Skip a leading backport tag before validating the header. The header
after the tag still has to be a conventional commit. The tag is accepted
only on PRs that target a release/* branch, so a backport opened against
main by mistake fails with a comment that says so. The title suggested
in the failure comment keeps the tag.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-16 10:33:46 -08:00

73 lines
2.1 KiB
YAML

name: Python CI Checks
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
permissions:
contents: read
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
pip install -r Tools/setup/test-requirements.txt
- name: Check MAVSDK test scripts with mypy
run: mypy --strict test/mavsdk_tests/*.py
- name: Check MAVSDK test scripts with flake8
run: flake8 --config test/mavsdk_tests/.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: Test PR title check
working-directory: Tools/ci
run: python3 -m unittest -v test_check_pr_title
- 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
- name: Check parameter file migration
run: |
flake8 Tools/migrate_param_file.py Tools/test_migrate_param_file.py
python3 -m unittest discover -s Tools -p 'test_migrate_param_file.py' -v