-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create initial upload of scripts used in aws-robotics Travis CI
- Loading branch information
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
## Travis Scripts | ||
# Travis Scripts | ||
|
||
contains scripts for building sample applications and AWS ROS cloud extensions. | ||
## Overview | ||
This repository contains scripts used in Travis CIs for [AWS RoboMaker] sample applications and [AWS RoboMaker] ROS Cloud Extensions. | ||
|
||
## License | ||
|
||
This library is licensed under the Apache 2.0 License. | ||
|
||
[AWS RoboMaker]: https://github.com/aws-robotics |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# install dependencies | ||
apt update && apt install -y lcov python3-pip libgtest-dev cmake && rosdep update | ||
cd /usr/src/gtest && cmake CMakeLists.txt && make && cp *.a /usr/lib | ||
apt update && apt install -y python3-colcon-common-extensions && pip3 install -U setuptools | ||
|
||
# use colcon as build tool to build the package, and optionally build tests | ||
. /opt/ros/$ROS_DISTRO/setup.sh | ||
cd /"$ROS_DISTRO"_ws/ | ||
rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y | ||
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage' | ||
if [ -z "${NO_TEST}" ]; | ||
then | ||
if [ ! -z "${PACKAGE_NAME}" ]; | ||
then | ||
colcon build --packages-select $PACKAGE_NAME --cmake-target tests | ||
fi | ||
|
||
# run unit tests | ||
. ./install/setup.sh | ||
colcon test | ||
colcon test-result --all | ||
|
||
# get unit test code coverage result | ||
lcov --capture --directory . --output-file coverage.info | ||
lcov --remove coverage.info '/usr/*' --output-file coverage.info | ||
lcov --list coverage.info | ||
cd /"$ROS_DISTRO"_ws/ | ||
mv coverage.info /shared | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# install dependencies | ||
apt update && apt install -y python3-pip python3-apt dpkg ros-$ROS_DISTRO-ros-base && rosdep update | ||
apt update && apt install -y python3-colcon-common-extensions && pip3 install -U setuptools | ||
pip3 install colcon-bundle colcon-ros-bundle | ||
. /opt/ros/$ROS_DISTRO/setup.sh | ||
|
||
# use colcon as build tool to build the robot workspace | ||
cd /"$ROS_DISTRO"_ws/"$SA_NAME"/robot_ws/ | ||
rosws update | ||
rosdep install --from-paths src --ignore-src -r -y | ||
colcon build --build-base build --install-base install | ||
colcon bundle --build-base build --install-base install --bundle-base bundle | ||
mv ./bundle/output.tar.gz ./bundle/robot.tar.gz | ||
|
||
# use colcon as build tool to build the simulation workspace | ||
cd /"$ROS_DISTRO"_ws/"$SA_NAME"/simulation_ws/ | ||
rosws update | ||
rosdep install --from-paths src --ignore-src -r -y | ||
colcon build --build-base build --install-base install | ||
colcon bundle --build-base build --install-base install --bundle-base bundle | ||
mv ./bundle/output.tar.gz ./bundle/simulation.tar.gz | ||
|
||
# move the artifacts to a shared mount point | ||
mv /"$ROS_DISTRO"_ws/"$SA_NAME"/robot_ws/bundle/robot.tar.gz /shared/robot.tar.gz | ||
mv /"$ROS_DISTRO"_ws/"$SA_NAME"/simulation_ws/bundle/simulation.tar.gz /shared/simulation.tar.gz |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# install dependencies | ||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116 | ||
echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list | ||
apt update && apt install -y python3 python3-pip libgtest-dev lcov cmake && rosdep update | ||
cd /usr/src/gtest && cmake CMakeLists.txt && make && cp *.a /usr/lib | ||
apt update && apt install -y python3-colcon-common-extensions && pip3 install -U setuptools | ||
|
||
# use colcon as build tool to build the package, and optionally build tests | ||
. /opt/ros/$ROS_DISTRO/setup.sh | ||
cd /"$ROS_DISTRO"_ws/ | ||
rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y | ||
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage' | ||
if [ -z "${NO_TEST}" ]; | ||
then | ||
if [ ! -z "${PACKAGE_NAME}" ] && [ "$ROS_VERSION" == "1" ]; | ||
then | ||
colcon build --packages-select $PACKAGE_NAME --cmake-target tests | ||
fi | ||
|
||
# run unit tests | ||
. ./install/setup.sh | ||
colcon test | ||
colcon test-result --all | ||
|
||
# get unit test code coverage result | ||
lcov --capture --directory . --output-file coverage.info | ||
lcov --remove coverage.info '/usr/*' --output-file coverage.info | ||
lcov --list coverage.info | ||
cd /"$ROS_DISTRO"_ws/ | ||
mv coverage.info /shared | ||
fi |