Skip to content

Commit 353392e

Browse files
authored
Merge pull request #116 from ros-perception/feature/ci-script
Bash script to run tests in CI
2 parents 2369b64 + 77d01e9 commit 353392e

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

.github/workflows/ros1_ci.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,22 @@
1-
name: CMake
1+
name: Build and run ROS tests
22

33
on:
44
push:
55
branches: [ kinetic-devel ]
66
pull_request:
77
branches: [ kinetic-devel ]
88

9-
env:
10-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11-
BUILD_TYPE: Release
12-
139
jobs:
1410
build:
15-
# The CMake configure and build commands are platform agnostic and should work equally
16-
# well on Windows or Mac. You can convert this to a matrix build if you need
17-
# cross-platform coverage.
18-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
1911
runs-on: ubuntu-latest
20-
12+
2113
container:
22-
image: ros:noetic-robot
14+
# The perception docker images includes laser_geometry, which we need.
15+
image: ros:noetic-perception
2316

2417
steps:
2518
- uses: actions/checkout@v2
2619

27-
- name: Build
28-
# Build your program with the given configuration
29-
run: cd ${{github.workspace}} && . /opt/ros/noetic/setup.sh && catkin build && catkin build
20+
- name: Build and run tests
21+
run: . /opt/ros/noetic/setup.sh && ./ci.sh
3022

31-
- name: Test
32-
working-directory: ${{github.workspace}}/build
33-
# Execute tests defined by the CMake configuration.
34-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
35-
run: ctest -C ${{env.BUILD_TYPE}}
36-

ci.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Exit with any error.
4+
set -e
5+
6+
# Should be run from the root directory of the repo.
7+
BUILD_DIR=build
8+
9+
cmake -B ${BUILD_DIR} -DCATKIN_ENABLE_TESTING=1
10+
11+
# Build.
12+
make -C ${BUILD_DIR}
13+
14+
# Build the tests.
15+
make -C ${BUILD_DIR} tests
16+
17+
# Run the tests.
18+
make -C ${BUILD_DIR} test
19+
20+
# Summarize test results (also sets the exit status for the script)
21+
catkin_test_results
22+

0 commit comments

Comments
 (0)