@@ -1044,7 +1044,7 @@ jobs:
10441044
10451045 mavros-tests :
10461046 name : " T3: MAVROS Tests [${{ matrix.config.name }}]"
1047- needs : [basic-tests, clang-tidy, ekf-functional-check, ubuntu-builds, macos-build, itcm-check, flash-analysis, failsafe-sim]
1047+ needs : [basic-tests, clang-tidy, ekf-functional-check, ubuntu-builds, macos-build, itcm-check, flash-analysis, failsafe-sim, build-sitl-gazebo-classic ]
10481048 if : >-
10491049 always()
10501050 && needs.basic-tests.result == 'success'
@@ -1054,42 +1054,81 @@ jobs:
10541054 && needs.macos-build.result == 'success'
10551055 && needs.itcm-check.result == 'success'
10561056 && needs.flash-analysis.result == 'success'
1057+ && needs.build-sitl-gazebo-classic.result == 'success'
10571058 runs-on : [runs-on,runner=4cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}",spot=false]
10581059 permissions :
10591060 contents : read
1061+ container :
1062+ image : px4io/px4-dev-ros-noetic:2021-09-08
1063+ options : --privileged --ulimit core=-1 --security-opt seccomp=unconfined
10601064 strategy :
10611065 fail-fast : false
10621066 matrix :
10631067 config :
10641068 - {name: "Mission", test_file: "mavros_posix_test_mission.test", params: "mission:=MC_mission_box vehicle:=iris"}
10651069 - {name: "Offboard", test_file: "mavros_posix_tests_offboard_posctl.test", params: "vehicle:=iris"}
10661070 steps :
1071+ - uses : runs-on/action@v2
1072+
10671073 - uses : actions/checkout@v4
10681074 with :
1069- fetch-depth : 0
1075+ fetch-depth : 1
1076+
1077+ - name : Setup - Configure Git Safe Directory
1078+ run : git config --system --add safe.directory '*'
1079+
1080+ - name : Setup - Install Python Test Dependencies
1081+ run : pip3 install pymavlink px4tools
1082+
1083+ - name : Cache - Restore ccache
1084+ uses : actions/cache/restore@v4
1085+ with :
1086+ path : ~/.ccache
1087+ key : ccache-sitl-gazebo-classic-${{ github.ref_name }}-${{ github.sha }}
1088+ restore-keys : |
1089+ ccache-sitl-gazebo-classic-${{ github.ref_name }}-
1090+ ccache-sitl-gazebo-classic-${{ github.base_ref || 'main' }}-
1091+ ccache-sitl-gazebo-classic-
1092+
1093+ - name : Cache - Configure ccache
1094+ run : |
1095+ mkdir -p ~/.ccache
1096+ echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
1097+ echo "compression = true" >> ~/.ccache/ccache.conf
1098+ echo "compression_level = 6" >> ~/.ccache/ccache.conf
1099+ echo "max_size = 400M" >> ~/.ccache/ccache.conf
1100+ echo "hash_dir = false" >> ~/.ccache/ccache.conf
1101+ echo "compiler_check = content" >> ~/.ccache/ccache.conf
1102+ ccache -s
1103+ ccache -z
1104+
1105+ - name : Build - PX4 Firmware (SITL)
1106+ run : make px4_sitl_default
1107+
1108+ - name : Cache - Stats after PX4 Firmware
1109+ run : ccache -s
10701110
1071- # PX4 fork of addnab/docker-run-action with Docker API v1.44+ support
1072- # Use docker-run-action instead of container: at job level because:
1073- # - ROS Melodic container is based on Ubuntu 18.04 (GLIBC 2.27)
1074- # - GitHub Actions' container: support injects Node 20 which requires GLIBC 2.28+
1075- # - docker-run-action runs the container separately, avoiding GLIBC compatibility issues
1076- # - This approach is future-proof as GitHub updates Node versions
1077- # TODO: Migrate to a newer ROS container with latest Ubuntu that meets GLIBC requirements
1078- # to use native container support and simplify the workflow configuration
1079- - name : Build and Test - MAVROS ${{ matrix.config.name }}
1111+ - name : Build - Gazebo Classic Plugins
1112+ run : make px4_sitl_default sitl_gazebo-classic
1113+
1114+ - name : Cache - Stats after Gazebo Plugins
1115+ run : ccache -s
1116+
1117+ - name : Test - MAVROS ${{ matrix.config.name }}
10801118 run : |
1081- docker run --rm \
1082- -v "${GITHUB_WORKSPACE}:/workspace" \
1083- -w /workspace \
1084- px4io/px4-dev-ros-melodic:2021-09-08 \
1085- bash -c '
1086- git config --global --add safe.directory /workspace
1087- make px4_sitl_default
1088- make px4_sitl_default sitl_gazebo-classic
1089- ./test/rostest_px4_run.sh \
1090- ${{ matrix.config.test_file }} \
1091- ${{ matrix.config.params }}
1092- '
1119+ ./test/rostest_px4_run.sh \
1120+ ${{ matrix.config.test_file }} \
1121+ ${{ matrix.config.params }}
1122+ timeout-minutes : 10
1123+
1124+ - name : Upload - Failed Test Logs
1125+ if : failure()
1126+ uses : actions/upload-artifact@v4
1127+ with :
1128+ name : failed-mavros-${{ matrix.config.name }}-logs.zip
1129+ path : |
1130+ logs/**/**/**/*.log
1131+ logs/**/**/**/*.ulg
10931132
10941133 ros-translation-node :
10951134 name : " T3: ROS Translation Node [${{ matrix.config.ros_version }}]"
0 commit comments