Skip to content

Commit 8498141

Browse files
committed
add ROS-O test
1 parent a8dfb7d commit 8498141

File tree

2 files changed

+60
-16
lines changed

2 files changed

+60
-16
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ jobs:
44
ci:
55
runs-on: ubuntu-latest
66
name: ci
7-
continue-on-error: true
87
strategy:
8+
fail-fast: false
99
matrix:
1010
include:
1111
- CHECK_PYTHON3_COMPILE : true
1212
- TEST : catkin_lint
13+
DOCKER_IMAGE : ubuntu:focal
1314
- TEST : clang-format
1415
- TEST : clang-tidy
1516
ROS_DISTRO : melodic
@@ -28,6 +29,10 @@ jobs:
2829
DOCKER_IMAGE : ubuntu:bionic
2930
- ROS_DISTRO : noetic
3031
DOCKER_IMAGE : ubuntu:focal
32+
- ROS_DISTRO : one
33+
DOCKER_IMAGE : ubuntu:jammy
34+
- ROS_DISTRO : one
35+
DOCKER_IMAGE : ubuntu:noble
3136
- TEST : debian-unstable
3237
DOCKER_IMAGE : debian:unstable
3338
steps:
@@ -49,7 +54,7 @@ jobs:
4954
run: python3 -m compileall .
5055
# catkin_lint
5156
- name: catkin_lint setup
52-
if: matrix.TEST == 'catkin_lint'
57+
if: matrix.TEST == 'catkin_lint' && matrix.DOCKER_IMAGE == ''
5358
run: |
5459
sudo apt-get install -y -q python3-pip
5560
# See https://github.com/ros-perception/opencv_apps/pull/143
@@ -58,7 +63,7 @@ jobs:
5863
sudo rosdep init
5964
rosdep update
6065
- name: catkin_lint test
61-
if: matrix.TEST == 'catkin_lint'
66+
if: matrix.TEST == 'catkin_lint' && matrix.DOCKER_IMAGE == ''
6267
run: |
6368
ROS_DISTRO=melodic catkin_lint --resolve-env --strict $PWD
6469
# clang-format
@@ -75,4 +80,4 @@ jobs:
7580
- name: script
7681
if: matrix.DOCKER_IMAGE
7782
run: |
78-
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 }}" ${{ matrix.DOCKER_IMAGE }} sh -c "cd $PWD; /bin/bash .travis.sh"
83+
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"

.travis.sh

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ function setup {
2626
travis_time_start setup.before_install
2727
#before_install:
2828
# Install ROS
29-
sudo sh -c "echo \"deb http://packages.ros.org/ros-shadow-fixed/ubuntu `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
29+
if [[ "$ROS_DISTRO" == "one" ]]; then
30+
UBUNTU_DISTRO=$(echo "$DOCKER_IMAGE" | cut -d':' -f2)
31+
echo "deb [trusted=yes] https://raw.githubusercontent.com/k-okada/ros-o-builder/$UBUNTU_DISTRO-one-unstable/repository/ ./" | sudo tee /etc/apt/sources.list.d/ros-o-builder.list
32+
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt install -y software-properties-common
33+
[[ "$UBUNTU_DISTRO" == "noble" ]] && sudo -E add-apt-repository -y ppa:v-launchpad-jochen-sprickerhof-de/ros
34+
[[ "$UBUNTU_DISTRO" == "jammy" ]] && sudo -E add-apt-repository -y ppa:k-okada/python3-catkin-tools
35+
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt install -y python3-rosdep2
36+
echo "yaml https://raw.githubusercontent.com/k-okada/ros-o-builder/$UBUNTU_DISTRO-one-unstable/repository/local.yaml debian" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-o-builder.list
37+
rosdep update
38+
else
39+
sudo sh -c "echo \"deb http://packages.ros.org/ros-shadow-fixed/ubuntu `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
40+
fi
3041
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
3142
# Setup EoL repository
3243
if [[ "$ROS_DISTRO" == "hydro" || "$ROS_DISTRO" == "jade" || "$ROS_DISTRO" == "lunar" ]]; then
@@ -41,15 +52,33 @@ function setup {
4152
fi
4253
###
4354
# Install ROS
44-
if [[ "$ROS_DISTRO" == "noetic" ]]; then
55+
if [[ "$ROS_DISTRO" == "one" ]]; then
56+
if [[ "$UBUNTU_DISTRO" == "jammy" ]]; then
57+
sudo apt-get install -y -q python3-catkin-pkg python3-wstool python3-rosinstall-generator python3-osrf-pycommon
58+
sudo apt-get install -y -q python3-catkin-tools
59+
else
60+
sudo apt-get install -y -q python3-pip python3-zombie-imp
61+
pip3 install --user --break-system-packages vcstool
62+
pip3 install --user --break-system-packages rosinstall-generator
63+
export PATH="$PATH:~/.local/bin"
64+
sudo apt-get install -y -q python3-catkin-pkg python3-osrf-pycommon
65+
sudo apt-get install -y -q catkin-tools
66+
fi
67+
elif [[ "$ROS_DISTRO" == "noetic" ]]; then
4568
sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon
4669
else
4770
sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator
4871
fi
49-
sudo apt-get install -y -q ros-$ROS_DISTRO-catkin
72+
if [[ "$ROS_DISTRO" == "one" ]]; then
73+
sudo apt-get install -y -q catkin
74+
sudo apt-get install -y -q ros-$ROS_DISTRO-rosbash ros-$ROS_DISTRO-ros-environment
75+
else
76+
sudo apt-get install -y -q ros-$ROS_DISTRO-catkin
77+
fi
78+
export ROS_DISTRO=$_ROS_DISTRO
5079
source /opt/ros/$ROS_DISTRO/setup.bash
5180
# Setup for rosdep
52-
sudo rosdep init
81+
[ -e /etc/ros/rosdep/sources.list.d ] || sudo rosdep init
5382
# use snapshot of rosdep list
5483
# https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517
5584
if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade"|"kinetic"|"lunar" ]]; then
@@ -78,14 +107,16 @@ function setup {
78107
#before_script:
79108
# source dependencies: install using wstool.
80109
cd ~/catkin_ws/src
81-
wstool init
110+
wstool init || echo "OK"
82111
#if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
83112
if [ "$OPENCV_VERSION" == 3 ]; then rosinstall_generator image_pipeline --upstream >> .rosinstall.opencv3; fi # need to recompile image_proc
84113
if [ "$OPENCV_VERSION" == 3 ]; then rosinstall_generator compressed_image_transport --upstream >> .rosinstall.opencv3; fi # need to recompile compressed_image_transport
85114
if [ "$OPENCV_VERSION" == 3 ]; then rosinstall_generator vision_opencv --upstream >> .rosinstall.opencv3; fi # need to recompile visoin_opencv
86-
if [ "$OPENCV_VERSION" == 3 ]; then wstool merge .rosinstall.opencv3; fi # need to recompile visoin_opencv
87-
wstool up
88-
wstool info
115+
if [ "$OPENCV_VERSION" == 3 ]; then wstool merge .rosinstall.opencv3 || [ ! -s .rosinstall.opencv3 ] || vcs import . < .rosinstall.opencv3 ; fi # need to recompile visoin_opencv
116+
git config --global --add safe.directory $CI_SOURCE_PATH
117+
git config --global --add safe.directory ~/catkin_ws/src || echo "OK"
118+
wstool up || vcs pull
119+
wstool info || vcs branch
89120
if [ "$OPENCV_VERSION" == 3 ]; then sed -i 's@libopencv-dev@opencv3@' */*/package.xml ; fi
90121

91122

@@ -96,6 +127,7 @@ function setup {
96127
}
97128

98129
function build {
130+
export ROS_DISTRO=$_ROS_DISTRO
99131
travis_time_start build.script
100132
source /opt/ros/$ROS_DISTRO/setup.bash
101133
cd ~/catkin_ws
@@ -104,6 +136,7 @@ function build {
104136
}
105137

106138
function run_test {
139+
export ROS_DISTRO=$_ROS_DISTRO
107140
travis_time_start run_test.script
108141
source /opt/ros/$ROS_DISTRO/setup.bash
109142
cd ~/catkin_ws
@@ -113,6 +146,7 @@ function run_test {
113146
}
114147

115148
function build_install {
149+
export ROS_DISTRO=$_ROS_DISTRO
116150
travis_time_start build_install.script
117151
source /opt/ros/$ROS_DISTRO/setup.bash
118152
cd ~/catkin_ws
@@ -122,20 +156,25 @@ function build_install {
122156
travis_time_end
123157
}
124158

159+
# setup.bash override ROS_DISTRO...
160+
export _ROS_DISTRO=$ROS_DISTRO
161+
125162
travis_time_start apt.before_install
126163
apt-get -y -qq update || if [ $? -eq 100 ]; then sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; apt-get -y -qq update; fi
127-
apt-get install -y -q wget sudo lsb-release gnupg # for docker
164+
apt-get install -y -q wget sudo lsb-release gnupg ca-certificates git # for docker
128165
# set DEBIAN_FRONTEND=noninteractive
129166
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
130167
travis_time_end
131168

132169
if [ "$TEST" == "catkin_lint" ]; then
133170

134171
travis_time_start catkin_lint.script
135-
apt-get install -y -q python-pip
136-
pip install catkin_lint rosdep
172+
apt-get install -y -q python3-pip
173+
# See https://github.com/ros-perception/opencv_apps/pull/143
174+
# In catkin_lint > 1.6.18, cmake_minimum_required >= 2.8.12
175+
sudo pip3 install catkin_lint==1.6.18 rosdep
137176
rosdep init
138-
rosdep update
177+
rosdep update --include-eol-distros
139178
travis_time_end
140179
ROS_DISTRO=melodic catkin_lint --resolve-env --strict $CI_SOURCE_PATH
141180

0 commit comments

Comments
 (0)