From 6cd3db88685bc0b664593ad5d383e85db76a87cb Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Wed, 15 Nov 2023 15:38:55 +0100 Subject: [PATCH] wip --- .ci/test.sh | 77 +++++++++++++++++++++++++++++++++++ .github/workflows/rostest.yml | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100755 .ci/test.sh diff --git a/.ci/test.sh b/.ci/test.sh new file mode 100755 index 0000000000..9d739f933b --- /dev/null +++ b/.ci/test.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +set -e + +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR + +LIST=mrs +VARIANT=testing +PACKAGE_NAME=$1 +WORKSPACE=/tmp/workspace + +YAML_FILE=${LIST}.yaml + +# needed for building open_vins +export ROS_VERSION=1 + +sudo apt-get -y install dpkg-dev + +ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) + +# we already have a docker image with ros for the ARM build +if [[ "$ARCH" != "arm64" ]]; then + curl https://ctu-mrs.github.io/ppa-$VARIANT/add_ros_ppa.sh | bash +fi + +curl https://ctu-mrs.github.io/ppa-$VARIANT/add_ppa.sh | bash + +# dependencies need for build the deb package +sudo apt-get -y install ros-noetic-catkin python3-catkin-tools +sudo apt-get -y install fakeroot debhelper +sudo pip3 install -U bloom + +REPOS=$(./.ci/get_repo_source.py $YAML_FILE $VARIANT $ARCH $PACKAGE_NAME) + +IDX=`cat "$IDX_FILE"` +IDX=$(($IDX+1)) + +echo "$0: this is the $IDX-th job in the pipeline" + +echo "$0: artifacts installed" + +# write the new incremented job idx to the shared file +echo "$IDX" > $IDX_FILE + +mkdir -p $WORKSPACE + +cd $WORKSPACE +mkdir src +source /opt/ros/noetic/setup.bash +catkin init + +cd src + +# clone and checkout +echo "$REPOS" | while IFS= read -r REPO; do + + PACKAGE=$(echo "$REPO" | awk '{print $1}') + URL=$(echo "$REPO" | awk '{print $2}') + BRANCH=$(echo "$REPO" | awk '{print $4}') + + echo "$0: cloning '$URL --depth 1 --branch $BRANCH' into '$PACKAGE'" + git clone $URL --recurse-submodules --shallow-submodules --depth 1 --branch $BRANCH $PACKAGE + +done + +cd $WORKSPACE/src + +echo "$0: building the workspace" + +catkin build + +echo "$0: testing" + +catkin test + +echo "$0: tests finished" diff --git a/.github/workflows/rostest.yml b/.github/workflows/rostest.yml index 1b24e4d007..50927c7614 100644 --- a/.github/workflows/rostest.yml +++ b/.github/workflows/rostest.yml @@ -49,7 +49,7 @@ jobs: token: ${{ secrets.PUSH_TOKEN }} - id: build run: | - echo "testing..." + /tmp/repository/.ci/test.sh "${{ matrix.job }}" merge: runs-on: ubuntu-20.04