mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
ci: test ubuntu 22.04 in ci
* missing and updated dependencies * setup: install zeromq for ubuntu 24.04 * cleans up ubuntu script
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
name: Ubuntu environment build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'stable'
|
||||||
|
- 'beta'
|
||||||
|
- 'release/**'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_and_test:
|
||||||
|
name: Build and Test Ubuntu
|
||||||
|
# strategy:
|
||||||
|
# fail-fast: false
|
||||||
|
# matrix:
|
||||||
|
# version: [ubuntu22, ubuntu24]
|
||||||
|
runs-on: [runs-on,runner=8cpu-linux-x64,"image=ubuntu22-full-x64","run-id=${{ github.run_id }}"]
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
./Tools/setup/ubuntu.sh
|
||||||
|
|
||||||
|
- name: Make Quick Check
|
||||||
|
run: |
|
||||||
|
make quick_check
|
||||||
|
|
||||||
|
# - name: Debug
|
||||||
|
# if: ${{ failure() }}
|
||||||
|
# uses: mxschmitt/action-tmate@v3
|
||||||
+7
-1
@@ -408,8 +408,14 @@ include(px4_add_gtest)
|
|||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
include(gtest)
|
include(gtest)
|
||||||
|
|
||||||
|
set(TESTFILTERARG "")
|
||||||
|
|
||||||
|
if(TESTFILTER)
|
||||||
|
set(TESTFILTERARG "-R ${TESTFILTER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_target(test_results
|
add_custom_target(test_results
|
||||||
COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test -R ${TESTFILTER} USES_TERMINAL
|
COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test ${TESTFILTERARG}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
px4
|
px4
|
||||||
examples__dyn_hello
|
examples__dyn_hello
|
||||||
|
|||||||
+11
-57
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
## Bash script to setup PX4 development environment on Ubuntu LTS (22.04, 20.04, 18.04).
|
## Bash script to setup PX4 development environment on Ubuntu LTS (24.04, 22.04).
|
||||||
## Can also be used in docker.
|
## Can also be used in docker.
|
||||||
##
|
##
|
||||||
## Installs:
|
## Installs:
|
||||||
@@ -53,23 +53,7 @@ fi
|
|||||||
# check ubuntu version
|
# check ubuntu version
|
||||||
# otherwise warn and point to docker?
|
# otherwise warn and point to docker?
|
||||||
UBUNTU_RELEASE="`lsb_release -rs`"
|
UBUNTU_RELEASE="`lsb_release -rs`"
|
||||||
|
echo "Ubuntu ${UBUNTU_RELEASE}"
|
||||||
if [[ "${UBUNTU_RELEASE}" == "14.04" ]]; then
|
|
||||||
echo "Ubuntu 14.04 is no longer supported"
|
|
||||||
exit 1
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "16.04" ]]; then
|
|
||||||
echo "Ubuntu 16.04 is no longer supported"
|
|
||||||
exit 1
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
|
|
||||||
echo "Ubuntu 18.04"
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
|
||||||
echo "Ubuntu 20.04"
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
|
|
||||||
echo "Ubuntu 22.04"
|
|
||||||
elif [[ "${UBUNTU_RELEASE}" == "21.3" ]]; then
|
|
||||||
echo "Linux Mint 21.3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing PX4 general dependencies"
|
echo "Installing PX4 general dependencies"
|
||||||
@@ -86,7 +70,7 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
|
|||||||
gdb \
|
gdb \
|
||||||
git \
|
git \
|
||||||
lcov \
|
lcov \
|
||||||
libfuse2 \
|
libssl-dev \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libxml2-utils \
|
libxml2-utils \
|
||||||
make \
|
make \
|
||||||
@@ -126,21 +110,26 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
|||||||
build-essential \
|
build-essential \
|
||||||
flex \
|
flex \
|
||||||
g++-multilib \
|
g++-multilib \
|
||||||
|
gcc-arm-none-eabi \
|
||||||
gcc-multilib \
|
gcc-multilib \
|
||||||
gdb-multiarch \
|
gdb-multiarch \
|
||||||
genromfs \
|
genromfs \
|
||||||
gettext \
|
gettext \
|
||||||
gperf \
|
gperf \
|
||||||
|
kconfig-frontends \
|
||||||
libelf-dev \
|
libelf-dev \
|
||||||
libexpat-dev \
|
libexpat-dev \
|
||||||
libgmp-dev \
|
libgmp-dev \
|
||||||
libisl-dev \
|
libisl-dev \
|
||||||
libmpc-dev \
|
libmpc-dev \
|
||||||
libmpfr-dev \
|
libmpfr-dev \
|
||||||
libncurses5 \
|
libncurses-dev \
|
||||||
libncurses5-dev \
|
libncurses6 \
|
||||||
libncursesw5-dev \
|
libncursesw6 \
|
||||||
|
libnewlib-arm-none-eabi \
|
||||||
|
libstdc++-arm-none-eabi-newlib \
|
||||||
libtool \
|
libtool \
|
||||||
|
libunwind-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
screen \
|
screen \
|
||||||
texinfo \
|
texinfo \
|
||||||
@@ -148,46 +137,11 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
|||||||
util-linux \
|
util-linux \
|
||||||
vim-common \
|
vim-common \
|
||||||
;
|
;
|
||||||
if [[ "${UBUNTU_RELEASE}" == "20.04" || "${UBUNTU_RELEASE}" == "22.04" || "${UBUNTU_RELEASE}" == "21.3" ]]; then
|
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
|
||||||
kconfig-frontends \
|
|
||||||
;
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$USER" ]; then
|
if [ -n "$USER" ]; then
|
||||||
# add user to dialout group (serial port access)
|
# add user to dialout group (serial port access)
|
||||||
sudo usermod -aG dialout $USER
|
sudo usermod -aG dialout $USER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# arm-none-eabi-gcc
|
|
||||||
NUTTX_GCC_VERSION="9-2020-q2-update"
|
|
||||||
NUTTX_GCC_VERSION_SHORT="9-2020q2"
|
|
||||||
|
|
||||||
source $HOME/.profile # load changed path for the case the script is reran before relogin
|
|
||||||
if [ $(which arm-none-eabi-gcc) ]; then
|
|
||||||
GCC_VER_STR=$(arm-none-eabi-gcc --version)
|
|
||||||
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}" || true)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$GCC_FOUND_VER" == "1" ]]; then
|
|
||||||
echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
|
||||||
wget -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-${INSTALL_ARCH}-linux.tar.bz2 && \
|
|
||||||
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
|
|
||||||
|
|
||||||
# add arm-none-eabi-gcc to user's PATH
|
|
||||||
exportline="export PATH=/opt/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}/bin:\$PATH"
|
|
||||||
|
|
||||||
if grep -Fxq "$exportline" $HOME/.profile; then
|
|
||||||
echo "${NUTTX_GCC_VERSION} path already set.";
|
|
||||||
else
|
|
||||||
echo $exportline >> $HOME/.profile;
|
|
||||||
source $HOME/.profile; # Allows to directly build NuttX targets in the same terminal
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Simulation tools
|
# Simulation tools
|
||||||
|
|||||||
Reference in New Issue
Block a user