diff --git a/.travis.yml b/.travis.yml index efeef658..80ddc87e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,6 @@ branches: before_install: - .travis/load_cache.sh - pip install --user gh-pr-comment - -install: true - script: - docker build --cache-from ${DOCKER_CACHE_REGISTRY}:${ROS_DISTRO_TARGET} @@ -45,3 +42,18 @@ script: $(bash <(curl -s https://codecov.io/env)) ${DOCKER_CACHE_TARGET}:${ROS_DISTRO_TARGET} /catkin_ws/src/${PACKAGE_NAME}/.travis/test.sh - bash -c "[ x${COVERAGE_TEST} != xtrue ] && .travis/save_cache.sh || true" + +jobs: + include: + - stage: prerelease-test + if: head_branch =~ ^release-.*$ + env: + - ROS_DISTRO_TARGET=kinetic COVERAGE_TEST=false + before_install: pip install --user gh-pr-comment + script: .travis/prerelease_test.sh + - stage: prerelease-test + if: head_branch =~ ^release-.*$ + env: + - ROS_DISTRO_TARGET=melodic COVERAGE_TEST=false + before_install: pip install --user gh-pr-comment + script: .travis/prerelease_test.sh diff --git a/.travis/prerelease_test.sh b/.travis/prerelease_test.sh new file mode 100755 index 00000000..b0f7760b --- /dev/null +++ b/.travis/prerelease_test.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -eu + +if [[ ! "${TRAVIS_PULL_REQUEST_BRANCH}" =~ ^release-.*$ ]]; then + echo "Skipping prerelease test" + exit 0 +fi + +case ${ROS_DISTRO_TARGET} in + kinetic ) + UBUNTU_DIST_TARGET=xenial + ;; + melodic ) + UBUNTU_DIST_TARGET=bionic + ;; + * ) + echo "Unknown ROS_DISTRO_TARGET: ${ROS_DISTRO_TARGET}" + exit 1 + ;; +esac + +echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ros-latest.list +sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 +sudo apt-get update -qq +sudo apt-get install -y --no-install-recommends python3-ros-buildfarm python3-pip git +sudo pip3 install git+https://github.com/ros/catkin + +mkdir -p /tmp/prerelease_job +cd /tmp/prerelease_job + +generate_prerelease_script.py \ + https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml \ + ${ROS_DISTRO_TARGET} default ubuntu ${UBUNTU_DIST_TARGET} amd64 \ + --custom-repo \ + neonavigation__custom-2:git:https://github.com/at-wat/neonavigation.git:${TRAVIS_PULL_REQUEST_BRANCH} \ + --level 1 \ + --output-dir ./ + +./prerelease.sh \ + && gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}-prerelease] PASSED on ${ROS_DISTRO_TARGET}" "" \ + || (gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}-prerelease] FAILED on ${ROS_DISTRO_TARGET}" ""; false)