mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
ci(checks): trim matrix, ccache tests, modernize python_checks
Port the checks.yml and python_checks.yml improvements from the CI orchestrator branch (mrpollo/ci_orchestration, PR #26257) without doing the full T1/T2 split. checks.yml: - Drop 5 matrix entries the orchestrator removed: tests_coverage, px4_fmu-v2_default stack_check, NO_NINJA_BUILD=1 px4_fmu-v5_default, NO_NINJA_BUILD=1 px4_sitl_default, px4_sitl_allyes. - Remove the codecov/codecov-action@v1 step (deprecated, only ran for the dropped tests_coverage entry). - Wire the setup-ccache / save-ccache composite actions around make tests (cache-key-prefix ccache-sitl, max-size 300M) so repeat runs reuse the SITL build tree. Matches the orchestrator basic-tests job 1:1. python_checks.yml: - Replace the apt-get install python3 + pip install --break-system-packages + hardcoded $HOME/.local/bin paths with actions/setup-python@v5 pinned to 3.10 and plain pip install. - Linters now run from PATH instead of $HOME/.local/bin. Stacks on top of mrpollo/ci-checkout-hygiene (#27032) which shipped fail-fast: true, fetch-depth: 1, and the safe.directory step extraction. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -30,13 +30,8 @@ jobs:
|
|||||||
"check_format",
|
"check_format",
|
||||||
"check_newlines",
|
"check_newlines",
|
||||||
"tests",
|
"tests",
|
||||||
"tests_coverage",
|
|
||||||
"px4_fmu-v2_default stack_check",
|
|
||||||
"validate_module_configs",
|
"validate_module_configs",
|
||||||
"shellcheck_all",
|
"shellcheck_all",
|
||||||
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
|
|
||||||
"NO_NINJA_BUILD=1 px4_sitl_default",
|
|
||||||
"px4_sitl_allyes",
|
|
||||||
"module_documentation",
|
"module_documentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -48,6 +43,13 @@ jobs:
|
|||||||
- name: Configure Git Safe Directory
|
- name: Configure Git Safe Directory
|
||||||
run: git config --system --add safe.directory '*'
|
run: git config --system --add safe.directory '*'
|
||||||
|
|
||||||
|
- uses: ./.github/actions/setup-ccache
|
||||||
|
id: ccache
|
||||||
|
if: matrix.check == 'tests'
|
||||||
|
with:
|
||||||
|
cache-key-prefix: ccache-sitl
|
||||||
|
max-size: 300M
|
||||||
|
|
||||||
- name: Building [${{ matrix.check }}]
|
- name: Building [${{ matrix.check }}]
|
||||||
env:
|
env:
|
||||||
PX4_SBOM_DISABLE: 1
|
PX4_SBOM_DISABLE: 1
|
||||||
@@ -55,10 +57,7 @@ jobs:
|
|||||||
cd "$GITHUB_WORKSPACE"
|
cd "$GITHUB_WORKSPACE"
|
||||||
make ${{ matrix.check }}
|
make ${{ matrix.check }}
|
||||||
|
|
||||||
- name: Uploading Coverage to Codecov.io
|
- uses: ./.github/actions/save-ccache
|
||||||
if: contains(matrix.check, 'coverage')
|
if: always() && matrix.check == 'tests'
|
||||||
uses: codecov/codecov-action@v1
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
|
||||||
flags: unittests
|
|
||||||
file: coverage/lcov.info
|
|
||||||
|
|||||||
@@ -20,14 +20,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Install Python3
|
- name: Setup Python
|
||||||
run: sudo apt-get install python3 python3-setuptools python3-pip -y
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: python3 -m pip install mypy types-requests flake8 --break-system-packages
|
run: pip install mypy types-requests flake8
|
||||||
|
|
||||||
- name: Check MAVSDK test scripts with mypy
|
- name: Check MAVSDK test scripts with mypy
|
||||||
run: $HOME/.local/bin/mypy --strict test/mavsdk_tests/*.py
|
run: mypy --strict test/mavsdk_tests/*.py
|
||||||
|
|
||||||
- name: Check MAVSDK test scripts with flake8
|
- name: Check MAVSDK test scripts with flake8
|
||||||
run: $HOME/.local/bin/flake8 test/mavsdk_tests/*.py
|
run: flake8 test/mavsdk_tests/*.py
|
||||||
|
|||||||
Reference in New Issue
Block a user