-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
101 lines (88 loc) · 3.45 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# NOTE: The build lifecycle on Travis.ci is something like this:
# before_install
# install
# before_script
# script
# after_success or after_failure
# after_script
# OPTIONAL before_deploy
# OPTIONAL deploy
# OPTIONAL after_deploy
# NOTE : change xenial to bionic and make corresponding changes
# if trying to test 18.04 / melodic
################################################################################
dist: xenial # or bionic
sudo: required
language:
- generic
cache:
- apt
env:
# Configuration variables. All variables are global now, but this can be used to
# trigger a build matrix for different ROS distributions if desired.
global:
- ROS_DISTRO=kinetic # or melodic
- ROS_CI_DESKTOP="`lsb_release -cs`" # e.g. [precise|trusty|...]
- CI_SOURCE_PATH=$(pwd)
- ROSINSTALL_FILE=$CI_SOURCE_PATH/.rosinstall
- ROS_PARALLEL_JOBS='-j8 -l6'
# Set the python path manually to include /usr/-/python2.7/dist-packages
# as this is where apt-get installs python packages.
- PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages
# system deps
before_install:
# Ros Repository Setup
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- travis_retry sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
- travis_retry sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- bash ./.travis/wait_for_apt.sh
- sudo apt-get update -qq
- sudo apt-get install -y python-catkin-pkg python-catkin-tools python-rosdep python-wstool ros-$ROS_DISTRO-catkin -y swig portaudio19-dev
# Python Package Install
- sudo apt-get install python-pip
- bash ./.travis/wait_for_apt.sh
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
# Install all dependencies, using wstool first and rosdep second.
# wstool looks for a ROSINSTALL_FILE defined in the environment variables.
# source dependencies: install using wstool.
# package depdencies: install using rosdep.
install:
# Create a catkin workspace with the package under integration.
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin_init_workspace
# Create the devel/setup.bash (run catkin build with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin build
- source devel/setup.bash
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .
# source dependencies with wstool
- cd ~/catkin_ws/src
- wstool init
- wstool merge $ROSINSTALL_FILE
- wstool up
# package dependencies with rosdep
- rosdep install --from-paths . --ignore-src --rosdistro=$ROS_DISTRO -y
# python dependencies with pip
- sudo pip2 install --quiet -r "$CI_SOURCE_PATH/requirements.txt"
before_script:
- cd ~/catkin_ws
- source /opt/ros/$ROS_DISTRO/setup.bash
- source devel/setup.bash
- rospack profile
# Compile and test (mark the build as failed if any step fails)
# TODO : add install targets and tests
script:
- cd ~/catkin_ws
- catkin build
# Run the tests, ensuring the path is set correctly.
#- source devel/setup.bash
#- rospack profile
#- travis_wait 60 catkin run_tests
#- catkin_test_results ~/catkin_ws