Skip to content

Commit

Permalink
Fix CI not failing on error (#30)
Browse files Browse the repository at this point in the history
Squash this PR

Push Job should fail, PR job should succeed.

Fixes #28
  • Loading branch information
PetervDooren authored Feb 10, 2023
2 parents d265233 + 82cc319 commit 7a04f6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function emc-update
if ! dpkg -s git &> /dev/null
then
echo "Going to install git"
sudo apt-get install git
sudo apt-get install -y -q git
fi

# Update the installer / updater if not in CI
Expand Down Expand Up @@ -72,8 +72,8 @@ alias pyro-open-door='rostopic pub --once /pyro/open_door std_msgs/Empty "{}"'

alias mrc-update=emc-update

if [ "$ROBOT_REAL" = true ] ;
then
if [ "$ROBOT_REAL" == true ]
then
alias hero-start='roslaunch mrc_hero_bringup start.launch --screen'
alias pyro-start='roslaunch rosbot_bringup start_emc.launch'
else
Expand Down
20 changes: 16 additions & 4 deletions setup/emc-update-impl.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#! /bin/bash

err_report()
{
exit_code=$?
echo -e "error(${exit_code}) on line $(caller)" >&2
trap - ERR
exit ${exit_code}
}

trap err_report ERR

# --------------------------------------------------------------------------------

function _make_sure_installed
Expand Down Expand Up @@ -41,7 +51,7 @@ function _make_sure_installed
done

# shellcheck disable=SC2086
sudo apt-get install -y $pkgs_to_install
sudo apt-get install -y -q $pkgs_to_install
fi
}

Expand Down Expand Up @@ -111,7 +121,7 @@ _git_clone_or_update https://github.com/tue-robotics/geolib2 "$EMC_SYSTEM_DIR"/s
_git_clone_or_update https://github.com/tue-robotics/code_profiler "$EMC_SYSTEM_DIR"/src/code_profiler
_git_clone_or_update https://github.com/husarion/rosbot_description.git "$EMC_SYSTEM_DIR"/src/rosbot_description

if [ ! "$ROBOT_REAL" = true ]
if [ "$ROBOT_REAL" != true ]
then
# Simbot specific packages
_git_clone_or_update https://github.com/husarion/rosbot_description.git "$EMC_SYSTEM_DIR"/src/rosbot_description
Expand All @@ -127,11 +137,13 @@ _make_sure_installed python3-catkin-tools libassimp-dev ros-"${EMC_ROS_DISTRO}"-
if [[ -n "$CI" ]]
then
# suppress status bar in CI
catkin build --workspace "$EMC_SYSTEM_DIR" --no-status
catkin build --workspace "$EMC_SYSTEM_DIR" -DCATKIN_ENABLE_TESTING=OFF --no-status
else
catkin build --workspace "$EMC_SYSTEM_DIR"
catkin build --workspace "$EMC_SYSTEM_DIR" -DCATKIN_ENABLE_TESTING=OFF
fi

# 5) Install the libraries
sudo cp "$EMC_SYSTEM_DIR"/devel/lib/libemc_system.so /usr/lib/libemc-framework.so
sudo cp "$EMC_SYSTEM_DIR"/src/emc_system/include/emc /usr/include/ -r

trap - ERR

0 comments on commit 7a04f6c

Please sign in to comment.