Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CI to an independent crate. #362

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 54 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Code format check
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
- name: Clippy
run: cargo clippy --all --examples -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JEnoch I updated the clippy argument here to match the one we used in Zenoh. I added --all-targets and --all-features to avoid the possible changes in the future. Also, --all is replaced by --workspace.


- name: Build zenoh-plugin-ros2dds
run: cargo build -p zenoh-plugin-ros2dds --verbose --all-targets
Expand All @@ -63,45 +63,59 @@ 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"
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: Code format check
shell: bash
run: 'source /opt/ros/humble/setup.bash && cd zenoh-test-ros2dds && cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"'
- name: Clippy
shell: bash
run: "source /opt/ros/humble/setup.bash && cd zenoh-test-ros2dds && cargo clippy --tests -- --deny warnings"

- name: Run ROS tests
shell: bash
run: "source /opt/ros/humble/setup.bash && cd zenoh-test-ros2dds && cargo 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: Code format check
shell: bash
run: 'source /opt/ros/jazzy/setup.bash && cd zenoh-test-ros2dds && cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"'
- name: Clippy
shell: bash
run: "source /opt/ros/jazzy/setup.bash && cd zenoh-test-ros2dds && cargo clippy --tests -- --deny warnings"

- name: Run ROS tests
shell: bash
run: "source /opt/ros/jazzy/setup.bash && cd zenoh-test-ros2dds && cargo test --verbose"

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
Expand Down
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-z
] }
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
# TODO: The ros_test should be re-enabled as soon the r2r dependency is removed from the build of zenoh-plugin-ros2dds
# r2r = "0.9"


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

# TODO: The ros_test should be re-enabled as soon the r2r dependency is removed from the build of zenoh-plugin-ros2dds
# ros_test = ["r2r"]

[dependencies]
async-trait = { workspace = true }
bincode = { workspace = true }
Expand All @@ -57,12 +54,6 @@ 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
140 changes: 0 additions & 140 deletions zenoh-plugin-ros2dds/tests/test.rs

This file was deleted.

33 changes: 33 additions & 0 deletions zenoh-test-ros2dds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (c) 2024 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#
[package]
name = "zenoh-test-ros2dds"
edition = "2021"

[dependencies]
cdr = "0.2.4"
futures = "0.3.26"
r2r = "0.9"
serde = "1.0.154"
serde_json = "1.0.114"
tokio = { version = "1.35.1", default-features = false } # Default features are disabled due to some crates' requirements
zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
"plugins",
"unstable",
] }
zenoh-config = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }
zenoh-plugin-ros2dds = { version = "1.0.0-dev", path = "../zenoh-plugin-ros2dds/", default-features = false }

# We need an empty workspace to avoid being viewed as a part of zenoh-plugin-ros2dds
[workspace]
Loading
Loading