Skip to content

Commit

Permalink
[ros2] CI overhaul (#106)
Browse files Browse the repository at this point in the history
* [appveyor] use colcon

* [appveyor] update packages to clone to match current ros2 master

* [appveyor] use Python 3.7

* [appveyor] use VS2017

* [travis] use colcon

* [travis] update dependencies and consolidate install steps

* [travis] use xenial and work around travis xenial dpkg issue
  • Loading branch information
mikaelarguedas authored Sep 14, 2018
1 parent c496ab2 commit 80a0398
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 53 deletions.
30 changes: 17 additions & 13 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 1.0.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
os: Visual Studio 2015
os: Visual Studio 2017
init:
- cmd: rd /s /q %CHOCOLATEYINSTALL%
- ps: iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
Expand All @@ -11,33 +11,37 @@ install:
- set "PATH=%PATH%;C:\Program Files\CMake\bin"
- cmake --version
- .\.appveyor\remove_python27_from_path.bat
- set "PATH=%PATH%;C:\Python35"
- set "PATH=%PATH%;C:\Python37"
- python --version
- python -m pip install -U setuptools pip
- python -m pip install EmPy
- python -m pip install trollius
- python -m pip install pyparsing
- python -m pip install colcon-core colcon-defaults colcon-library-path colcon-metadata colcon-output colcon-package-information colcon-package-selection colcon-parallel-executor colcon-powershell colcon-python-setup-py colcon-recursive-crawl colcon-test-result colcon-cmake colcon-ros
- mkdir build
- cd build
- mkdir src
- cd src
- python -c "import shutil; shutil.copytree('../..', './class_loader', ignore=shutil.ignore_patterns('build'))"
- git clone https://github.com/ros/console_bridge.git
- git clone https://github.com/ros2/poco_vendor.git
- mkdir ament
- cd ament
- git clone https://github.com/ament/ament_cmake.git
- git clone https://github.com/ament/ament_lint.git
- git clone https://github.com/ament/ament_package.git
- git clone https://github.com/ament/ament_tools.git
- git clone https://github.com/osrf/osrf_pycommon.git
- git clone https://github.com/ament/googletest
- git clone https://github.com/ament/googletest.git
- git clone https://github.com/ament/uncrustify_vendor.git
- cd ..
- mkdir ros2
- cd ros2
- git clone https://github.com/ros2/console_bridge_vendor.git
- git clone https://github.com/ros2/poco_vendor.git
- cd ..\..\..
- '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64'
- set "PATH=%PATH%;C:\Python35"
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
- set "PATH=%PATH%;C:\Python37;C:\Python37\Scripts"
build_script:
- cd build
- |
python -u src\ament\ament_tools\scripts\ament.py build --build-tests
- python -u src\ament\ament_tools\scripts\ament.py test --skip-build --skip-install --only class_loader
- colcon build --packages-up-to class_loader --packages-skip class_loader
- colcon build --packages-select class_loader --event-handlers console_direct+
- colcon test --packages-select class_loader --event-handlers console_direct+ --ctest-args -E cppcheck
- colcon test-result --test-result-base build
deploy: off
test: off
55 changes: 33 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,54 @@
sudo: required
language: python
python:
- 3.5
language: generic
os:
- linux
- osx
dist: trusty
dist: xenial
env:
global:
- AMENT_WS=~/ament_ws
- AMENT_WS_SRC=${AMENT_WS}/src
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
bash ./.travis/wait_for_apt.sh
fi
install:
- make -f .travis/Makefile install_deps
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz"
mkdir cmake35 && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake35
export PATH=`pwd`/cmake35/bin:${PATH}
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -qq
sudo apt-get install cmake cppcheck libxml2-utils libpoco-dev python3 python3-pip python3-empy python3-pyparsing python3-setuptools wget
else
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
brew update
brew outdated cmake || brew upgrade cmake || brew install cmake
brew install cppcheck console_bridge poco uncrustify
brew outdated python3 || brew upgrade python3 || brew install python3
fi
- python3 --version
- sudo -H python3 -m pip install -U setuptools pip pyparsing
- sudo -H python3 -m pip install catkin_pkg EmPy
- sudo -H python3 -m pip install -U colcon-bash colcon-core colcon-defaults colcon-library-path colcon-metadata colcon-output colcon-package-information colcon-package-selection colcon-parallel-executor colcon-python-setup-py colcon-recursive-crawl colcon-test-result colcon-cmake colcon-ros
- sudo -H python3 -m pip install -U flake8 flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes pytest pytest-repeat pytest-rerunfailures pytest-cov pytest-runner setuptools
script:
- mkdir -p build/src/ament
- cd build
- touch AMENT_IGNORE
- mkdir -p $AMENT_WS_SRC/ament
- mkdir -p $AMENT_WS_SRC/ros2
# Fetch dependencies into the workspace
- cd src/ament
- cd $AMENT_WS_SRC/ament
- git clone https://github.com/ament/ament_cmake.git
- git clone https://github.com/ament/ament_lint.git
- git clone https://github.com/ament/ament_package.git
- git clone https://github.com/ament/ament_tools.git
- git clone https://github.com/osrf/osrf_pycommon.git
- git clone https://github.com/ament/googletest
- cd ..
- git clone https://github.com/ros/console_bridge.git
- git clone https://github.com/ament/googletest.git
- git clone https://github.com/ament/uncrustify_vendor.git
- cd $AMENT_WS_SRC/ros2
- git clone https://github.com/ros2/console_bridge_vendor.git
- git clone https://github.com/ros2/poco_vendor.git
- cd ..
- cd $AMENT_WS
# Link source into workspace's source space
- ln -s $TRAVIS_BUILD_DIR ./src
# Build
- python3 -u ./src/ament/ament_tools/scripts/ament.py build --build-tests --ament-cmake-args -DPYTHON_VERSION=3 -- --end-with class_loader
- colcon build --packages-up-to class_loader --packages-skip class_loader
- colcon build --packages-select class_loader --event-handlers console_direct+
# Test
- python3 -u ./src/ament/ament_tools/scripts/ament.py test --skip-build --skip-install --only class_loader
- colcon test --packages-select class_loader --event-handlers console_direct+
- colcon test-result --test-result-base build
18 changes: 0 additions & 18 deletions .travis/Makefile

This file was deleted.

9 changes: 9 additions & 0 deletions .travis/wait_for_apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
while sleep 1; do
if [ $(pgrep apt | wc -l) -lt 1 ] ; then
echo "apt process done"
break
else
echo "apt process is not done yet"
fi
done

0 comments on commit 80a0398

Please sign in to comment.