Skip to content

Commit 50277e3

Browse files
authored
Add basic CI (#19)
* Add basic CI Signed-off-by: Evan Flynn <[email protected]> * Fix xmllint error by reordering license before author Signed-off-by: Evan Flynn <[email protected]> * Fix uncrustify errors in dynmsg_demo package Signed-off-by: Evan Flynn <[email protected]> * Add missing includes for Jammy compilation Signed-off-by: Evan Flynn <[email protected]> Signed-off-by: Evan Flynn <[email protected]>
1 parent 4afd277 commit 50277e3

File tree

5 files changed

+85
-16
lines changed

5 files changed

+85
-16
lines changed

.github/workflows/build_test.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '**'
9+
pull_request:
10+
branches:
11+
- main
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
env:
16+
WORKSPACE_PATH: ros_ws
17+
CLONE_PATH: ros_ws/src/${{ github.events.repo.name }}
18+
19+
# only run one build doc workflow at a time, cancel any running ones
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
build-and-test:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
ros_distribution:
31+
- foxy
32+
- galactic
33+
- humble
34+
- rolling
35+
include:
36+
# Foxy Fitzroy (June 2020 - May 2023)
37+
- ros_distribution: foxy
38+
docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
39+
# Galactic Geochelone (May 2021 - November 2022)
40+
- ros_distribution: galactic
41+
docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
42+
# Humble Hawksbill (May 2022 - May 2027)
43+
- ros_distribution: humble
44+
docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
45+
# Rolling Ridley (June 2020 - Present)
46+
- ros_distribution: rolling
47+
docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
48+
container:
49+
image: ${{ matrix.docker_image }}
50+
# Steps represent a sequence of tasks that will be executed as part of the job
51+
steps:
52+
- name: Setup workspace
53+
run: mkdir -p ${{ env.CLONE_PATH }}
54+
- name: checkout
55+
uses: actions/checkout@v2
56+
with:
57+
path: ${{ env.CLONE_PATH }}
58+
- name: Build and test
59+
uses: ros-tooling/[email protected]
60+
with:
61+
package-name: dynmsg dynmsg_demo dynmsg_msgs test_dynmsg
62+
target-ros2-distro: ${{ matrix.ros_distribution }}
63+
vcs-repo-file-url: ""
64+
- name: Upload logs as artifacts
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: build_and_test_logs_${{ matrix.ros_distribution }}
68+
path: ${{ env.WORKSPACE_PATH }}/log

dynmsg/include/dynmsg/vector_utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define DYNMSG__VECTOR_UTILS_HPP_
1717

1818
#include <cstdint>
19+
#include <cstddef>
1920

2021
namespace dynmsg
2122
{

dynmsg_demo/src/cli.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ using namespace std::string_literals;
2323

2424
void print_help_and_exit(const char * program_name)
2525
{
26-
std::cout << "Usage:\n"
27-
<< " " << program_name << " echo <topic>\n"
28-
<< " " << program_name << " publish <topic> <type> <message>\n"
29-
<< " " << program_name << " call <service> <request>\n"
30-
<< " " << program_name << " host <service> <response>\n"
31-
<< " " << program_name << " discover\n"
32-
<< std::endl;
26+
std::cout << "Usage:\n" <<
27+
" " << program_name << " echo <topic>\n" <<
28+
" " << program_name << " publish <topic> <type> <message>\n" <<
29+
" " << program_name << " call <service> <request>\n" <<
30+
" " << program_name << " host <service> <response>\n" <<
31+
" " << program_name << " discover\n" <<
32+
std::endl;
3333
exit(1);
3434
}
3535

dynmsg_demo/src/cli_tool.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ int print_topics(const rcl_node_t * node)
218218
}
219219
std::cout << "topics:" << std::endl;
220220
for (size_t i = 0; i < topics.names.size; i++) {
221-
std::cout << " " << topics.names.data[i]
222-
<< " [" << topics.types[i].data[0] << "]" << std::endl;
221+
std::cout << " " << topics.names.data[i] <<
222+
" [" << topics.types[i].data[0] << "]" << std::endl;
223223
}
224224
ret = rcl_names_and_types_fini(&topics);
225225
if (ret != RCL_RET_OK) {
@@ -246,9 +246,9 @@ int print_services(const rcl_node_t * node)
246246
}
247247
std::cout << "services:" << std::endl;
248248
for (size_t i = 0; i < services.names.size; i++) {
249-
std::cout << " " << services.names.data[i]
250-
<< " [" << services.types[i].data[0] << "]"
251-
<< std::endl;
249+
std::cout << " " << services.names.data[i] <<
250+
" [" << services.types[i].data[0] << "]" <<
251+
std::endl;
252252
}
253253
ret = rcl_names_and_types_fini(&services);
254254
if (ret != RCL_RET_OK) {
@@ -275,9 +275,9 @@ int print_actions(const rcl_node_t * node)
275275
}
276276
std::cout << "actions:" << std::endl;
277277
for (size_t i = 0; i < actions.names.size; i++) {
278-
std::cout << " " << actions.names.data[i]
279-
<< " [" << actions.types[i].data[0] << "]"
280-
<< std::endl;
278+
std::cout << " " << actions.names.data[i] <<
279+
" [" << actions.types[i].data[0] << "]" <<
280+
std::endl;
281281
}
282282
ret = rcl_names_and_types_fini(&actions);
283283
if (ret != RCL_RET_OK) {

dynmsg_msgs/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<version>1.0.0</version>
66
<description>Test messages for dynamic message type loading</description>
77
<maintainer email="[email protected]">Geoffrey Biggs</maintainer>
8+
<license>Apache 2.0</license>
89
<author email="[email protected]">Geoffrey Biggs</author>
910
<author email="[email protected]">Koon Peng Teo</author>
10-
<license>Apache 2.0</license>
1111

1212
<buildtool_depend>ament_cmake</buildtool_depend>
1313

0 commit comments

Comments
 (0)