add ros-o test #248
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: [push, pull_request] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| name: ci | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - CHECK_PYTHON3_COMPILE : true | |
| - TEST : catkin_lint | |
| DOCKER_IMAGE : ubuntu:focal | |
| - TEST : clang-format | |
| - TEST : clang-tidy | |
| ROS_DISTRO : melodic | |
| DOCKER_IMAGE : ubuntu:bionic | |
| - ROS_DISTRO : hydro | |
| DOCKER_IMAGE : ubuntu:precise | |
| - OPENCV_VERSION : 2 | |
| ROS_DISTRO : indigo | |
| DOCKER_IMAGE : ubuntu:trusty | |
| - OPENCV_VERSION : 3 | |
| ROS_DISTRO : indigo | |
| DOCKER_IMAGE : ubuntu:trusty | |
| - ROS_DISTRO : kinetic | |
| DOCKER_IMAGE : ubuntu:xenial | |
| - ROS_DISTRO : melodic | |
| DOCKER_IMAGE : ubuntu:bionic | |
| - ROS_DISTRO : noetic | |
| DOCKER_IMAGE : ubuntu:focal | |
| - ROS_DISTRO : one | |
| DOCKER_IMAGE : ubuntu:jammy | |
| - ROS_DISTRO : one | |
| DOCKER_IMAGE : ubuntu:noble | |
| - TEST : debian-unstable | |
| DOCKER_IMAGE : debian:unstable | |
| steps: | |
| - name: Setup OS | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get upgrade -y | |
| - name: Setup Git | |
| run: | | |
| sudo apt-get install -y git | |
| - name: Chcekout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| # python3_check | |
| - name: python3_check | |
| if: matrix.CHECK_PYTHON3_COMPILE == true | |
| run: python3 -m compileall . | |
| # catkin_lint | |
| - name: catkin_lint setup | |
| if: matrix.TEST == 'catkin_lint' && matrix.DOCKER_IMAGE == '' | |
| run: | | |
| sudo apt-get install -y -q python3-pip | |
| # See https://github.com/ros-perception/opencv_apps/pull/143 | |
| # In catkin_lint > 1.6.18, cmake_minimum_required >= 2.8.12 | |
| sudo pip3 install catkin_lint==1.6.18 rosdep | |
| sudo rosdep init | |
| rosdep update | |
| - name: catkin_lint test | |
| if: matrix.TEST == 'catkin_lint' && matrix.DOCKER_IMAGE == '' | |
| run: | | |
| ROS_DISTRO=melodic catkin_lint --resolve-env --strict $PWD | |
| # clang-format | |
| - name: clang-format setup | |
| if: matrix.TEST == 'clang-format' | |
| run: | | |
| sudo apt-get install -y -q clang-format git | |
| - name: clang-format test | |
| if: matrix.TEST == 'clang-format' | |
| run: | | |
| find $PWD -name '*.h' -or -name '*.hpp' -or -name '*.cpp' | xargs clang-format -i -style=file | |
| git -C $PWD --no-pager diff | |
| git -C $PWD diff-index --quiet HEAD -- . | |
| - name: script | |
| if: matrix.DOCKER_IMAGE | |
| run: | | |
| docker run --rm -i -v $PWD:$PWD -e "CI_SOURCE_PATH=$PWD" -e "HOME=$HOME" -e "ROS_DISTRO=${{ matrix.ROS_DISTRO }}" -e "OPENCV_VERSION=${{ matrix.OPENCV_VERSION }}" -e "TEST=${{ matrix.TEST }}" -e "DOCKER_IMAGE=${{ matrix.DOCKER_IMAGE }}" ${{ matrix.DOCKER_IMAGE }} sh -c "cd $PWD; /bin/bash .travis.sh" | |
| # ROS-O setup for v4hn https://github.com/v4hn/ros-o-builder/blob/jammy-one/README.md#install-instructions | |
| # ROS-O setup for techfak https://ros.packages.techfak.net/ | |
| # note that v4hn uses ROS_DISTRO=one and techfak uses ROS_DISTRO | |
| ros-o: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| DEB_DISTRO: [22.04, 24.04] | |
| ARCH: [x64, arm64] | |
| ROS_ONE_VARIANT: [techfak] | |
| runs-on: ${{ matrix.ARCH == 'x64' && format('ubuntu-{0}', matrix.DEB_DISTRO) || (matrix.ARCH == 'arm64' && format('ubuntu-{0}-arm', matrix.DEB_DISTRO) || format('ubuntu-{0}', matrix.DEB_DISTRO)) }} | |
| env: | |
| DEBIAN_FRONTEND : noninteractive | |
| steps: | |
| - name: Chcekout Source | |
| uses: actions/[email protected] | |
| - name: Setup ROS-O deb repository | |
| run: | | |
| set -x | |
| sudo apt update && sudo apt install -qq -y ca-certificates git | |
| if [[ "${{ matrix.DEB_DISTRO }}" == "22.04" ]]; then export CODE_NAME="jammy"; fi | |
| if [[ "${{ matrix.DEB_DISTRO }}" == "24.04" ]]; then export CODE_NAME="noble"; fi | |
| echo "deb [trusted=yes] https://ros.packages.techfak.net $CODE_NAME-testing main" | sudo tee /etc/apt/sources.list.d/ros-o-builder.list | |
| ## | |
| # https://github.com/v4hn/ros-deb-builder-action/blob/b7c0ed93fde3a86b5b1027bf8f7145cad6067c90/prepare.sh#L27-L28 | |
| # Canonical dropped the Debian ROS packages from 24.04 for political reasons. Wow. | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "v4hn" && "${{ matrix.DISTRO }}" == "ubuntu:24.04" ]]; then apt install -y software-properties-common retry && retry -d 50,10,30,300 -t 12 add-apt-repository -y ppa:v-launchpad-jochen-sprickerhof-de/ros; fi | |
| ## | |
| sudo apt update | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "v4hn" ]]; then | |
| sudo apt install -qq -y python3-rosdep2 | |
| fi | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "techfak" ]]; then | |
| # Do not install python3-rosdep2, which is an outdated version of rosdep shipped via the Ubuntu repositories (instead of ROS)! | |
| sudo apt install -qq -y python3-rosdep | |
| sudo rosdep init | |
| fi | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "v4hn" ]]; then | |
| export ROSDEP_PACKAGE_MAPPING="yaml https://raw.githubusercontent.com/v4hn/ros-o-builder/jammy-one/repository/local.yaml debian" | |
| fi | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "techfak" ]]; then | |
| export ROSDEP_PACKAGE_MAPPING="yaml https://ros.packages.techfak.net/ros-one.yaml ubuntu" | |
| fi | |
| echo $ROSDEP_PACKAGE_MAPPING | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-o-builder.list | |
| rosdep update | |
| shell: bash | |
| - name: Setup catkin-tools | |
| run: | | |
| set -x | |
| # setup catkin tools | |
| sudo apt install -qq -y python3-pip | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "v4hn" ]]; then | |
| pip3 install catkin-tools==0.9.4 | |
| sudo apt install -qq -y catkin | |
| fi | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "techfak" ]]; then | |
| sudo apt install -qq -y ros-one-catkin python3-catkin-tools | |
| fi | |
| # setup build tools | |
| sudo apt install -qq -y cmake build-essential ros-one-rosbash | |
| shell: bash | |
| - name: Setup Workspace | |
| run: | | |
| source /opt/ros/one/setup.bash | |
| set -x | |
| # setup workspace | |
| mkdir -p ~/ws/src | |
| cd ~/ws/src | |
| ln -sf $GITHUB_WORKSPACE . | |
| rosdep install -qq -r -y --from-path . --ignore-src || echo "OK" | |
| # check all system packages are able to install, because ROS-O build deb files that needs all packages | |
| PIP_BREAK_SYSTEM_PACKAGES=1 rosdep install -qq --simulate -y --from-path . --ignore-src -t exec -t buildtool_export -t buildtool -t build -t build_export | tee rosdep-install.sh | |
| # catkin_tools is not available on v4hn/jammy | |
| if [[ "${{ matrix.ROS_ONE_VARIANT }}" == "v4hn" ]]; then sed -i '/python3-catkin-tools/s/^/#/' rosdep-install.sh; fi | |
| sed 's/apt-get install/apt-get -y install/;/install ros-one/s/^/#/;/pip3 install/s/^/#/' rosdep-install.sh | bash -xe | |
| shell: bash | |
| - name: Compile Packages | |
| run: | | |
| source /opt/ros/one/setup.bash | |
| set -x | |
| cd ~/ws/ | |
| catkin build --no-status -sv ${{ matrix.CATKIN_OPTIONS }} --cmake-args -DCATKIN_ENABLE_TESTING=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ${{ matrix.CMAKE_OPTIONS }} | |
| shell: bash |