mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Consolidate mavros_mission_tests.yml and mavros_offboard_tests.yml into a single mavros_tests.yml with a matrix strategy. Switch from docker-in-docker with px4-dev-ros-melodic to a native container using px4-dev-ros-noetic, enabling ccache and composite actions (setup-ccache, build-gazebo-sitl, save-ccache). Migrate all five MAVROS Python test files from Python 2 to Python 3 (remove six/xrange, from __future__ imports, replace px4tools with pyulog for estimator analysis). Bump git-auto-commit-action from v4 to v7 in ekf_update_change_indicator.yml. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
name: MAVROS Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: "MAVROS ${{ matrix.config.name }}"
|
|
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
|
permissions:
|
|
contents: read
|
|
container:
|
|
image: px4io/px4-dev-ros-noetic:2021-09-08
|
|
env:
|
|
PX4_SBOM_DISABLE: 1
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- {name: "Mission", test_file: "mavros_posix_test_mission.test", params: "mission:=MC_mission_box vehicle:=iris"}
|
|
- {name: "Offboard", test_file: "mavros_posix_tests_offboard_posctl.test", params: "vehicle:=iris"}
|
|
steps:
|
|
- uses: runs-on/action@v2
|
|
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup - Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- name: Setup - Install Python Test Dependencies
|
|
run: pip3 install -r Tools/setup/requirements.txt
|
|
|
|
- uses: ./.github/actions/setup-ccache
|
|
id: ccache
|
|
with:
|
|
cache-key-prefix: ccache-sitl-gazebo-classic
|
|
max-size: 350M
|
|
|
|
- uses: ./.github/actions/build-gazebo-sitl
|
|
|
|
- name: Test - MAVROS ${{ matrix.config.name }}
|
|
run: |
|
|
./test/rostest_px4_run.sh \
|
|
${{ matrix.config.test_file }} \
|
|
${{ matrix.config.params }}
|
|
timeout-minutes: 10
|
|
|
|
- uses: ./.github/actions/save-ccache
|
|
if: always()
|
|
with:
|
|
cache-primary-key: ${{ steps.ccache.outputs.cache-primary-key }}
|
|
|
|
- name: Upload - Failed Test Logs
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: failed-mavros-${{ matrix.config.name }}-logs.zip
|
|
path: |
|
|
logs/**/**/**/*.log
|
|
logs/**/**/**/*.ulg
|