Skip to content

Commit d53271d

Browse files
committed
Add ROS2 to CI and add a small test for it
1 parent 22af997 commit d53271d

File tree

13 files changed

+217
-7
lines changed

13 files changed

+217
-7
lines changed

.github/workflows/build-ros1.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build-cpython:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
name: [
19+
"ubuntu-py39",
20+
"ubuntu-py310",
21+
"ubuntu-py311",
22+
]
23+
include:
24+
- name: "ubuntu-py39"
25+
os: ubuntu-latest
26+
python-version: "3.9"
27+
- name: "ubuntu-py310"
28+
os: ubuntu-latest
29+
python-version: "3.10"
30+
- name: "ubuntu-py311"
31+
os: ubuntu-latest
32+
python-version: "3.11"
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
python -m pip install wheel
43+
- name: Install
44+
run: |
45+
python -m pip install --no-cache-dir -r requirements-dev.txt
46+
- name: Set up docker containers
47+
run: |
48+
docker build -t gramaziokohler/rosbridge:integration_tests_ros1 ./docker/ros1
49+
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests_ros1 /bin/bash -c "roslaunch /integration-tests.launch"
50+
docker ps -a
51+
- name: Run linter
52+
run: |
53+
invoke check
54+
- name: Run tests
55+
run: |
56+
pytest tests/ros1
57+
- name: Tear down docker containers
58+
run: |
59+
docker rm -f rosbridge

.github/workflows/build-ros2.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build-cpython:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
name: [
19+
"ubuntu-py39",
20+
"ubuntu-py310",
21+
"ubuntu-py311",
22+
]
23+
include:
24+
- name: "ubuntu-py39"
25+
os: ubuntu-latest
26+
python-version: "3.9"
27+
- name: "ubuntu-py310"
28+
os: ubuntu-latest
29+
python-version: "3.10"
30+
- name: "ubuntu-py311"
31+
os: ubuntu-latest
32+
python-version: "3.11"
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
python -m pip install wheel
43+
- name: Install
44+
run: |
45+
python -m pip install --no-cache-dir -r requirements-dev.txt
46+
- name: Set up docker containers
47+
run: |
48+
docker build -t gramaziokohler/rosbridge:integration_tests_ros2 ./docker/ros2
49+
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests_ros2 /bin/bash -c "ros2 launch /integration-tests.launch"
50+
docker ps -a
51+
- name: Run linter
52+
run: |
53+
invoke check
54+
- name: Run tests
55+
run: |
56+
pytest tests/ros2
57+
- name: Tear down docker containers
58+
run: |
59+
docker rm -f rosbridge

docker/ros2/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ SHELL ["/bin/bash","-c"]
66
# Install rosbridge
77
RUN apt-get update && apt-get install -y \
88
ros-iron-rosbridge-suite \
9-
ros-iron-tf2-web-republisher \
10-
ros-iron-ros-tutorials \
11-
ros-iron-actionlib-tutorials \
9+
# ros-iron-tf2-web-republisher \
10+
# ros-iron-ros-tutorials \
11+
# ros-iron-actionlib-tutorials \
1212
--no-install-recommends \
1313
# Clear apt-cache to reduce image size
1414
&& rm -rf /var/lib/apt/lists/*

docker/ros2/integration-tests.launch

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<launch>
2-
<include file="$(find-pkg-share rosbridge_server)/launch/rosbridge_websocket_launch.xml">
3-
<arg name="port" value="9092"/>
4-
</include>
2+
<include file="$(find-pkg-share rosbridge_server)/launch/rosbridge_websocket_launch.xml" />
53
<!-- <node pkg="tf2_web_republisher" type="tf2_web_republisher" name="tf2_web_republisher"></node> -->
64
</launch>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)