diff --git a/.github/workflows/ros1_ci.yml b/.github/workflows/ros1_ci.yml index e03efdd9..2b34fab8 100644 --- a/.github/workflows/ros1_ci.yml +++ b/.github/workflows/ros1_ci.yml @@ -1,4 +1,4 @@ -name: CMake +name: Build and run ROS tests on: push: @@ -6,31 +6,17 @@ on: pull_request: branches: [ kinetic-devel ] -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - jobs: build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest - + container: - image: ros:noetic-robot + # The perception docker images includes laser_geometry, which we need. + image: ros:noetic-perception steps: - uses: actions/checkout@v2 - - name: Build - # Build your program with the given configuration - run: cd ${{github.workspace}} && . /opt/ros/noetic/setup.sh && catkin build && catkin build + - name: Build and run tests + run: . /opt/ros/noetic/setup.sh && ./ci.sh - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - diff --git a/ci.sh b/ci.sh new file mode 100755 index 00000000..34231702 --- /dev/null +++ b/ci.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Exit with any error. +set -e + +# Should be run from the root directory of the repo. +BUILD_DIR=build + +cmake -B ${BUILD_DIR} -DCATKIN_ENABLE_TESTING=1 + +# Build. +make -C ${BUILD_DIR} + +# Build the tests. +make -C ${BUILD_DIR} tests + +# Run the tests. +make -C ${BUILD_DIR} test + +# Summarize test results (also sets the exit status for the script) +catkin_test_results +