-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
70 lines (57 loc) · 3.08 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
language: generic
services:
- docker
branches:
except:
- gh-pages
env:
# This will check any ROS distro with any python interpreter
# supported on this OS
# Disabling ROS workflow checks since pyros_setup should be used only with pip dependencies, only when catkin is not available.
# => making a ROS package from it is not supported (and not needed anyway).
global:
- CONTAINER_NAME=pyros_setup_docker
# This will check any ROS distro supported on this OS
# checking devel and install separately so that they don't influence each other (dependencies, path, env, etc.)
matrix:
# REMINDER : Python3 is NOT supported by ROS.
- ROS_DISTRO=indigo PYTHON=2.7
#- ROS_DISTRO=indigo PYTHON=3.4
- ROS_DISTRO=kinetic PYTHON=2.7
#- ROS_DISTRO=kinetic PYTHON=3.5
- ROS_DISTRO=melodic PYTHON=2.7
#- ROS_DISTRO=melodic PYTHON=3.6
# TODO : pypy + pypy3
before_install:
# Getting docker ros image
- docker pull ros:${ROS_DISTRO}-ros-core
# Running as daemon
- docker run --name ${CONTAINER_NAME} -d -t ros:${ROS_DISTRO}-ros-core /bin/bash | tee container.id
# Checking current container
- docker ps -a
- docker exec -ti ${CONTAINER_NAME} hostname
- docker exec -ti ${CONTAINER_NAME} uname -a
- docker exec -ti ${CONTAINER_NAME} cat /etc/lsb-release
install:
# refreshing packages
- docker exec -ti ${CONTAINER_NAME} apt-get update
- docker exec -ti ${CONTAINER_NAME} rosdep update
# Install python and required packages on system if needed
- docker exec -ti ${CONTAINER_NAME} apt-get install python${PYTHON} virtualenvwrapper -y
# copying local clone to the running container (volume is currently broken)
- docker cp . ${CONTAINER_NAME}:/git_clone
# getting virtualenv setup with dependencies
- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh && mkvirtualenv --python=/usr/bin/python${PYTHON} --system-site-packages -i \"pip>=9\" -i \"setuptools>12\" -i /git_clone -a /git_clone -q python_${PYTHON}_ros"
# full ROS setup, build and test
script:
- CONTAINER_ID=$(cat container.id)
- docker ps -a
- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh && workon python_${PYTHON}_ros && mkdir -p testing && cd testing && echo 'Testing default detected distro' && pyros_setup --pytest"
- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh && workon python_${PYTHON}_ros && mkdir -p testing && cd testing && echo 'Testing default created config' && pyros_setup --pytest"
# This currently breaks because of https://github.com/pytest-dev/pytest/issues/1889
# TODO fix it.
#- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh && workon python_${PYTHON}_ros && mkdir -p testing && cd testing && echo 'Testing overloaded correct config succeed' && pyros_setup --pytest --distro ${CI_ROS_DISTRO}"
# TODO : test that --distro not matching travis setup actually fail as expected
- docker stop "${CONTAINER_ID}"
notifications:
email: false