From 4ff765cf644ef7b949b7db010410fa964c121e97 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Wed, 11 Mar 2020 13:56:30 +0100 Subject: [PATCH 1/8] Use github actions to perform CI - One source build to test against latest master - One build on top of nightly image to give quick feedback Signed-off-by: Mikael Arguedas --- .codecov.yml | 2 ++ .github/workflows/test.yml | 56 ++++++++++++++++++++++++++++++++++++++ sros2/.coveragerc | 4 +++ 3 files changed, 62 insertions(+) create mode 100644 .codecov.yml create mode 100644 .github/workflows/test.yml create mode 100644 sros2/.coveragerc diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..2dcdcb86 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +fixes: + - "ros_ws/src/sros2/::" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..8d014076 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Test sros2 +on: + pull_request: + push: + schedule: + # Run daily + - cron: '0 12 * * *' + +jobs: + test_latest: + runs-on: ubuntu-latest + container: osrf/ros2:devel + steps: + - run: | + apt-get -qq update + apt-get -qq upgrade -y + apt-get -qq install -y curl libasio-dev libtinyxml2-dev + - uses: mikaelarguedas/action-ros-ci@sros2-version + with: + package-name: | + sros2 + sros2_cmake + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.6 + if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') + with: + file: ros_ws/build/sros2/coverage.xml + flags: unittests + name: sros2-coverage + fail_ci_if_error: true + yml: .codecov.yml + - name: Upload Logs + uses: actions/upload-artifact@v1 + if: failure() + with: + name: colcon-logs + path: ros_ws/log + test_nightly: + runs-on: ubuntu-latest + container: osrf/ros2:nightly + steps: + - uses: actions/checkout@v1 + - run: | + apt-get -qq update + apt-get -qq upgrade -y + rosdep update + rosdep install -y --from-paths . --ignore-src --rosdistro foxy + - run: . /opt/ros/foxy/setup.sh && colcon build + - run: . /opt/ros/foxy/setup.sh && colcon test + - run: colcon test-result + - name: Upload Logs + uses: actions/upload-artifact@v1 + if: failure() + with: + name: colcon-logs + path: ros_ws/log diff --git a/sros2/.coveragerc b/sros2/.coveragerc new file mode 100644 index 00000000..c07be3ca --- /dev/null +++ b/sros2/.coveragerc @@ -0,0 +1,4 @@ +[run] +omit = + # omit test directory + test/* From 0db80e51127bb7d731ff82afb164b535da47e1db Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Thu, 26 Mar 2020 22:44:16 +0100 Subject: [PATCH 2/8] comment integration tests until fastrtps is fixed Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d014076..e80e2d59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: package-name: | sros2 sros2_cmake + # commented for now https://github.com/eProsima/Fast-RTPS/issues/1087 + # test_security - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.6 if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') From 9cbfe85c394bd233fa046878c84d97e8cb7b7af8 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Fri, 27 Mar 2020 09:02:29 +0100 Subject: [PATCH 3/8] comment out end-to-end testing for now Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e80e2d59..934cf8ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,8 +20,9 @@ jobs: package-name: | sros2 sros2_cmake - # commented for now https://github.com/eProsima/Fast-RTPS/issues/1087 - # test_security + # skipping end-to-end tests for now https://github.com/eProsima/Fast-RTPS/issues/1087 + # test_security + # extra-cmake-args: '-DSECURITY=ON --no-warn-unused-cli' - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.6 if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') From 0fe2eecb19a5f2b8a786cc4644fdff93c2c1f3de Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Fri, 27 Mar 2020 09:02:47 +0100 Subject: [PATCH 4/8] add badges to readme Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 2 +- README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 934cf8ac..0eca81a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test sros2 +name: SROS2 CI on: pull_request: push: diff --git a/README.md b/README.md index 97b99dcf..0853a646 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Context +![SROS2 CI](https://github.com/ros2/sros2/workflows/SROS2%20CI/badge.svg) +[![codecov](https://codecov.io/gh/ros2/sros2/branch/master/graph/badge.svg)](https://codecov.io/gh/ros2/sros2) + This package provides the tools and instructions to use ROS2 on top of DDS-Security. The security feature is tested across platforms (Linux, macOS, and Windows) as well as across different languages (C++ and Python). From 25126f6b96d342b29213f9b690f56f9d31a0fd03 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Fri, 27 Mar 2020 09:19:48 +0100 Subject: [PATCH 5/8] use ROS_DISTRO env var Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0eca81a7..ea00a058 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,9 +47,9 @@ jobs: apt-get -qq update apt-get -qq upgrade -y rosdep update - rosdep install -y --from-paths . --ignore-src --rosdistro foxy - - run: . /opt/ros/foxy/setup.sh && colcon build - - run: . /opt/ros/foxy/setup.sh && colcon test + rosdep install -y --from-paths . --ignore-src --rosdistro $ROS_DISTRO + - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon build + - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon test - run: colcon test-result - name: Upload Logs uses: actions/upload-artifact@v1 From bbda7ffa4944efc76094f2ba7dc83b8d7f1edcf5 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Fri, 27 Mar 2020 09:24:32 +0100 Subject: [PATCH 6/8] test sequentially and print to console Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea00a058..b6e06886 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: rosdep update rosdep install -y --from-paths . --ignore-src --rosdistro $ROS_DISTRO - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon build - - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon test + - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon test --executor sequential --event-handlers console_direct+ - run: colcon test-result - name: Upload Logs uses: actions/upload-artifact@v1 From 3963861047d53a2b223b9e522c5a8312ea39e85e Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Fri, 27 Mar 2020 09:31:33 +0100 Subject: [PATCH 7/8] run after nightly docker images rebuild Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6e06886..12fdb722 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: push: schedule: # Run daily - - cron: '0 12 * * *' + - cron: '0 20 * * *' jobs: test_latest: From 535a700bb73a831bfb70e0020e5f3a31f44472b6 Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Tue, 31 Mar 2020 10:06:01 +0200 Subject: [PATCH 8/8] add comment about using upstream action-ros-ci Signed-off-by: Mikael Arguedas --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12fdb722..4b0d2355 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,8 @@ jobs: apt-get -qq update apt-get -qq upgrade -y apt-get -qq install -y curl libasio-dev libtinyxml2-dev + # TODO(mikaelarguedas) switch back to ros-tooling/action-ros-ci once + # https://github.com/ros-tooling/action-ros-ci/pull/109 is released - uses: mikaelarguedas/action-ros-ci@sros2-version with: package-name: |