diff --git a/.appveyor.yml b/.appveyor.yml index 8aa64c62..1980a76b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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')) @@ -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 diff --git a/.travis.yml b/.travis.yml index 79795d59..96b2eafa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/Makefile b/.travis/Makefile deleted file mode 100644 index a8c10431..00000000 --- a/.travis/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -all: class_loader - -UNAME := $(shell uname -s) - -install_deps: -ifeq ($(UNAME),Darwin) - brew update - brew outdated python3 || brew upgrade python3 || brew install python3 - brew outdated poco || brew upgrade poco || brew install poco - sudo -H python3 -m pip install -U empy pyparsing -else - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' - wget http://packages.ros.org/ros.key -O - | sudo apt-key add - - sudo apt-get update -qq - sudo apt-get install cmake python3 python3-pip python3-empy python3-pyparsing python3-setuptools wget libpoco-dev - sudo -H python3 -m pip install -U pyparsing -endif - python3 --version diff --git a/.travis/wait_for_apt.sh b/.travis/wait_for_apt.sh new file mode 100644 index 00000000..8b3083fe --- /dev/null +++ b/.travis/wait_for_apt.sh @@ -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