Skip to content

Commit

Permalink
Add ROS test with CI. (#350)
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
Co-authored-by: Julien Enoch <[email protected]>
  • Loading branch information
evshary and JEnoch authored Dec 5, 2024
1 parent 0fa2b15 commit f4990b1
Show file tree
Hide file tree
Showing 6 changed files with 388 additions and 9 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,46 @@ jobs:
- name: Run tests
run: cargo test --verbose

system_tests_with_ros2_humble:
name: System tests with ROS 2 Humble
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
steps:
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble

- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install ACL
run: sudo apt-get -y install libacl1-dev

- name: Run ROS tests (enable feature ros_test)
shell: bash
run: "source /opt/ros/humble/setup.bash && cargo test --features ros_test --verbose"

system_tests_with_ros2_jazzy:
name: System tests with ROS 2 Jazzy
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
steps:
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: jazzy

- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Install ACL
run: sudo apt-get -y install libacl1-dev

- name: Run ROS tests (enable feature ros_test)
shell: bash
run: "source /opt/ros/jazzy/setup.bash && cargo test --features ros_test --verbose"

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
Expand Down
186 changes: 185 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ zenoh-plugin-ros2dds = { version = "1.0.0-dev", path = "zenoh-plugin-ros2dds/",
zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features=["static_plugin"]}
zenoh-plugin-trait = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }

# r2r is for tests only. See in in zenoh-plugins-ros2dds/Cargo.toml
r2r = "0.9"


[profile.release]
codegen-units = 1
Expand Down
8 changes: 8 additions & 0 deletions zenoh-plugin-ros2dds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ default = ["dynamic_plugin"]
stats = ["zenoh/stats"]
dynamic_plugin = []
dds_shm = ["cyclors/iceoryx"]
ros_test = ["r2r"]

[dependencies]
async-trait = { workspace = true }
Expand All @@ -50,9 +51,16 @@ test-case = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
zenoh = { workspace = true }
zenoh-config = { workspace = true }
zenoh-ext = { workspace = true }
zenoh-plugin-trait = { workspace = true }

# r2r is for tests only. It has to be optional because its building requires a full ROS 2 environement
# However "optional" is not supported for "dev-dependencies".
# Hence it's declared as a dependency but active only with "ros_test" feature
r2r = { workspace = true, optional = true }


[build-dependencies]
rustc_version = { workspace = true }

Expand Down
Loading

0 comments on commit f4990b1

Please sign in to comment.