Skip to content

Commit

Permalink
Add a test for all supported distros
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed May 25, 2023
1 parent e100d83 commit afbf77f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,39 @@ jobs:
- uses: docker://koalaman/shellcheck-alpine
with:
args: /bin/sh -c "shellcheck -x *.sh industrial_ci/scripts/*_ci industrial_ci/src/*.sh industrial_ci/src/*/*.sh"

distro:
strategy:
fail-fast: false
matrix:
distro:
- indigo
- jade
- kinetic
- lunar
- melodic
- noetic
- ardent
- bouncy
- crystal
- dashing
- eloquent
- foxy
- galactic
- humble
- iron
- rolling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ardent does not support conditions in package.xml
run: |
echo "BEFORE_BUILD_TARGET_WORKSPACE=sed -i /condition/d /root/target_ws/src/industrial_ci/industrial_ci/package.xml" >> "$GITHUB_ENV"
if: matrix.distro == 'ardent'
- uses: './'
env:
ROS_DISTRO: ${{ matrix.distro }}

ici:
env:
TRACE: true
Expand All @@ -44,7 +77,6 @@ jobs:
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: file, ROSINSTALL_FILENAME: .ci.rosinstall} # Testing arbitrary file name without ROS_DISTRO suffix. As of 6/3/2016 this fails due to https://github.com/ros-industrial/industrial_core/pull/144#issuecomment-223186764
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: file, ROSINSTALL_FILENAME: .i.do.not.exist, EXPECT_EXIT_CODE: 1}
- {DOCKER_IMAGE: 'ros:kinetic-ros-base', ROS_REPO: ros, NOT_TEST_BUILD: true, DEBUG_BASH: true, VERBOSE_OUTPUT: false, DOCKER_COMMIT: img_temp, POST_PROCESS: 'eval docker image inspect $$DOCKER_COMMIT --format="$$DOCKER_COMMIT:\ \"{{.Size}}\" bytes"'}
- {ROS_DISTRO: lunar, ROS_REPO: 'ros-shadow-fixed', TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: noetic, AFTER_SCRIPT: 'grep -q ID=ubuntu /etc/os-release && grep -q VERSION_CODENAME=focal /etc/os-release'}
- {ROS_DISTRO: noetic, BEFORE_INIT: 'grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"10\" /etc/os-release', EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, OS_NAME: debian, OS_CODE_NAME: buster, AFTER_SCRIPT: 'grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"10\" /etc/os-release'}
Expand All @@ -55,14 +87,9 @@ jobs:
- {DOCKER_IMAGE: "ros:noetic", ROS_REPO: testing, AFTER_INIT: "grep -r ros-testing /etc/apt && ici_exit 1 || ici_exit 2", EXPECT_EXIT_CODE: 1}
- {DOCKER_IMAGE: "ros:melodic", AFTER_INIT: "grep -r ros-testing /etc/apt && ici_exit 1 || ici_exit 2", EXPECT_EXIT_CODE: 2}
- {DOCKER_IMAGE: "ros:melodic", ROS_REPO: testing, AFTER_INIT: "grep -r ros-testing /etc/apt && ici_exit 1 || ici_exit 2", EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: noetic, PRERELEASE: true}
- {ROS_DISTRO: noetic, AFTER_SCRIPT: 'rosenv rosrun industrial_ci run_travis', ADDITIONAL_DEBS: "ros-noetic-rosbash"}
- {ROS_DISTRO: foxy, AFTER_SCRIPT: 'rosenv ros2 run industrial_ci run_travis', ADDITIONAL_DEBS: "ros-foxy-ros2run"}
- {ROS_DISTRO: galactic, TRACE: true}
- {ROS_DISTRO: humble}
- {ROS_DISTRO: iron}
- {ROS_DISTRO: rolling}

# Are CXXFLAGS correctly passed? These tests should fail due to -Werror (exit code is for catkin tools: 1 and for colcon: 2)
- {ROS_DISTRO: melodic, CXXFLAGS: "-Werror", EXPECT_EXIT_CODE: 1, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
Expand Down
2 changes: 1 addition & 1 deletion industrial_ci/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 2.8.12)
project(industrial_ci)

if("$ENV{ROS_VERSION}" EQUAL "2")
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake</buildtool_depend>
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake_python</buildtool_depend>
<buildtool_depend>ros_environment</buildtool_depend>
<buildtool_depend condition="$ROS_PYTHON_VERSION == 2">python-setuptools</buildtool_depend>
<buildtool_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_depend>
<buildtool_depend condition="$ROS_DISTRO != indigo and $ROS_DISTRO != jade">ros_environment</buildtool_depend>
<buildtool_depend condition="$ROS_DISTRO == indigo or $ROS_DISTRO == jade">roslib</buildtool_depend>

<exec_depend>coreutils</exec_depend>
<exec_depend>python3-yaml</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-yaml</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-yaml</exec_depend>

<export>
<build_type condition="$ROS_VERSION == 1">catkin</build_type>
Expand Down
2 changes: 1 addition & 1 deletion industrial_ci/src/builders/colcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function builder_setup {
ici_install_pkgs_for_command colcon python3-colcon-common-extensions
if [ "$ROS_DISTRO" = "kinetic" ] || [ "$ROS_DISTRO" = "ardent" ]; then
ici_install_pkgs_for_command pip3 python3-pip
ici_asroot pip3 install -U setuptools
ici_asroot pip3 install -U setuptools==30.3.0
fi
}

Expand Down

0 comments on commit afbf77f

Please sign in to comment.