diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 4915ec36..573f118c 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -22,7 +22,7 @@ jobs: # Default commands to running the book directory of our workspace working-directory: book steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Install mdbook - name: Setup mdBook diff --git a/.github/workflows/galactic.yml b/.github/workflows/galactic.yml deleted file mode 100644 index b03e406b..00000000 --- a/.github/workflows/galactic.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Note: each job is in a separate workflow to support individual CI badges in the readme -name: Galactic - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - HOME: /root - # Coupled with our use of the test_log crate this should give us good CI output on failure - RUST_LOG: debug - -jobs: - galactic: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - container: carter12s/roslibrust-ci-galactic:rust_1_90 - timeout-minutes: 20 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Verify rust version - run: source /root/.cargo/env; rustc --version - - name: Lint - run: source /root/.cargo/env; cargo fmt --all -- --check - - name: Start rosbridge - run: source /opt/ros/galactic/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 - - name: Integration Tests - run: source /root/.cargo/env; cargo test --features ros2_test -- --test-threads 1 \ No newline at end of file diff --git a/.github/workflows/humble.yml b/.github/workflows/humble.yml deleted file mode 100644 index 3dec7ea4..00000000 --- a/.github/workflows/humble.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Note: each job is in a separate workflow to support individual CI badges in the readme -name: Humble - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - HOME: /root - # Coupled with our use of the test_log crate this should give us good CI output on failure - RUST_LOG: debug - -jobs: - humble: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - container: carter12s/roslibrust-ci-humble:rust_1_90 - timeout-minutes: 20 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Verify rust version - run: source /root/.cargo/env; rustc --version - - name: Lint - run: source /root/.cargo/env; cargo fmt --all -- --check - - name: Start rosbridge - run: source /opt/ros/humble/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 - - name: Integration Tests - run: source /root/.cargo/env; cargo test --features ros2_test -- --test-threads 1 \ No newline at end of file diff --git a/.github/workflows/iron.yml b/.github/workflows/iron.yml deleted file mode 100644 index 755ca853..00000000 --- a/.github/workflows/iron.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Note: each job is in a separate workflow to support individual CI badges in the readme -name: Iron - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - HOME: /root - # Coupled with our use of the test_log crate this should give us good CI output on failure - RUST_LOG: debug - -jobs: - iron: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - container: carter12s/roslibrust-ci-iron:rust_1_90 - timeout-minutes: 20 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Lint - run: source /root/.cargo/env; cargo fmt --all -- --check - - name: Start rosbridge - run: source /opt/ros/iron/setup.bash; ros2 launch rosbridge_server rosbridge_websocket_launch.xml & disown; ros2 run rosapi rosapi_node & sleep 1 - - name: Integration Tests - run: source /root/.cargo/env; cargo test --features ros2_test -- --test-threads 1 \ No newline at end of file diff --git a/.github/workflows/kilted.yml b/.github/workflows/kilted.yml deleted file mode 100644 index 7d330fde..00000000 --- a/.github/workflows/kilted.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Note: each job is in a separate workflow to support individual CI badges in the readme -name: Kilted - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - HOME: /root - # Coupled with our use of the test_log crate this should give us good CI output on failure - RUST_LOG: debug - -jobs: - kilted: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - container: carter12s/roslibrust-ci-kilted:rust_1_90 - timeout-minutes: 20 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Lint - run: source /root/.cargo/env; cargo fmt --all -- --check - - name: Start services and run integration tests - run: | - source /opt/ros/kilted/setup.bash - ros2 launch rosbridge_server rosbridge_websocket_launch.xml & - ros2 run rosapi rosapi_node & - ros2 run rmw_zenoh_cpp rmw_zenohd -l tcp/0.0.0.0:7447 > zenoh.log 2>&1 & - sleep 2 - source /root/.cargo/env - cargo test --features ros2_zenoh_test,ros2_test -- --test-threads 1 \ No newline at end of file diff --git a/.github/workflows/noetic.yml b/.github/workflows/noetic.yml index 6ca2139c..b8dd6946 100644 --- a/.github/workflows/noetic.yml +++ b/.github/workflows/noetic.yml @@ -3,9 +3,9 @@ name: Noetic on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] env: HOME: /root @@ -23,9 +23,9 @@ jobs: timeout-minutes: 20 steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - submodules: 'true' + submodules: "true" - name: Verify rust version run: source /root/.cargo/env; rustc --version - name: Lint @@ -33,4 +33,4 @@ jobs: - name: Start rosbridge run: source /opt/ros/noetic/setup.bash; roslaunch rosbridge_server rosbridge_websocket.launch & disown; rosrun rosapi rosapi_node & sleep 1 - name: Build and Test - run: source /opt/ros/noetic/setup.bash; source /root/.cargo/env; RUST_LOG=debug cargo test --features ros1_test,all -- --test-threads 1 \ No newline at end of file + run: source /opt/ros/noetic/setup.bash; source /root/.cargo/env; RUST_LOG=debug cargo test --features ros1_test,all -- --test-threads 1 diff --git a/.github/workflows/noetic_gencpp.yml b/.github/workflows/noetic_gencpp.yml index 41e85bd5..ceed1ea9 100644 --- a/.github/workflows/noetic_gencpp.yml +++ b/.github/workflows/noetic_gencpp.yml @@ -2,9 +2,9 @@ name: Noetic gencpp on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] env: HOME: /root @@ -21,8 +21,8 @@ jobs: timeout-minutes: 5 steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - submodules: 'true' + submodules: "true" - name: Compile test package - run: cd roslibrust_genmsg/test_package; mkdir -p cmake_build; cd cmake_build; cmake .. -DCMAKE_BUILD_TYPE=Release; make -j6; \ No newline at end of file + run: cd roslibrust_genmsg/test_package; mkdir -p cmake_build; cd cmake_build; cmake .. -DCMAKE_BUILD_TYPE=Release; make -j6; diff --git a/.github/workflows/rolling.yml b/.github/workflows/rolling.yml deleted file mode 100644 index 10504392..00000000 --- a/.github/workflows/rolling.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Note: each job is in a separate workflow to support individual CI badges in the readme -name: Rolling - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - HOME: /root - # Coupled with our use of the test_log crate this should give us good CI output on failure - RUST_LOG: debug - -jobs: - rolling: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - container: carter12s/roslibrust-ci-rolling:rust_1_91 - timeout-minutes: 20 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Lint - run: source /root/.cargo/env; cargo fmt --all -- --check - - name: Start services and run integration tests - run: | - source /opt/ros/rolling/setup.bash - ros2 launch rosbridge_server rosbridge_websocket_launch.xml & - ros2 run rosapi rosapi_node & - ros2 run rmw_zenoh_cpp rmw_zenohd -l tcp/0.0.0.0:7447 > zenoh.log 2>&1 & - sleep 2 - source /root/.cargo/env - cargo test --features ros2_zenoh_test,ros2_test -- --test-threads 1 - diff --git a/.github/workflows/ros2.yml b/.github/workflows/ros2.yml new file mode 100644 index 00000000..8cbb8ae4 --- /dev/null +++ b/.github/workflows/ros2.yml @@ -0,0 +1,79 @@ +# Consolidated ROS2 CI workflow using matrix strategy +# Each distro appears as a separate job in the GitHub UI for individual status/badges +# Badge URL format: https://github.com/OWNER/REPO/actions/workflows/ros2.yml/badge.svg?branch=master +name: ROS2 + +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + HOME: /root + # Coupled with our use of the test_log crate this should give us good CI output on failure + RUST_LOG: debug + +jobs: + ros2: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - distro: galactic + container: carter12s/roslibrust-ci-galactic:rust_1_90 + features: ros2_test + zenoh: false + - distro: humble + container: carter12s/roslibrust-ci-humble:rust_1_90 + features: ros2_test + zenoh: false + - distro: iron + container: carter12s/roslibrust-ci-iron:rust_1_90 + features: ros2_test + zenoh: false + - distro: kilted + container: carter12s/roslibrust-ci-kilted:rust_1_90 + features: ros2_zenoh_test,ros2_test + zenoh: true + - distro: rolling + container: carter12s/roslibrust-ci-rolling:rust_1_91 + features: ros2_zenoh_test,ros2_test + zenoh: true + + name: ${{ matrix.distro }} + container: ${{ matrix.container }} + timeout-minutes: 20 + defaults: + run: + shell: bash + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Lint + run: source /root/.cargo/env && cargo fmt --all -- --check + + - name: Start rosbridge services + run: | + source /opt/ros/${{ matrix.distro }}/setup.bash + ros2 launch rosbridge_server rosbridge_websocket_launch.xml & + ros2 run rosapi rosapi_node & + sleep 1 + + - name: Start zenoh daemon + if: matrix.zenoh + run: | + source /opt/ros/${{ matrix.distro }}/setup.bash + ros2 run rmw_zenoh_cpp rmw_zenohd -l tcp/0.0.0.0:7447 > zenoh.log 2>&1 & + sleep 1 + + - name: Integration Tests + run: | + source /root/.cargo/env + cargo test --features ${{ matrix.features }} -- --test-threads 1 + diff --git a/README.md b/README.md index 7824502e..917bfe09 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ # RosLibRust -[![Noetic](https://github.com/roslibrust/roslibrust/actions/workflows/noetic.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/noetic.yml) -[![Galactic](https://github.com/roslibrust/roslibrust/actions/workflows/galactic.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/galactic.yml) -[![Humble](https://github.com/roslibrust/roslibrust/actions/workflows/humble.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/humble.yml) -[![Iron](https://github.com/roslibrust/roslibrust/actions/workflows/iron.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/iron.yml) -[![Kilted](https://github.com/roslibrust/roslibrust/actions/workflows/kilted.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/kilted.yml) -[![Rolling](https://github.com/roslibrust/roslibrust/actions/workflows/rolling.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/rolling.yml) +[![ROS1](https://github.com/roslibrust/roslibrust/actions/workflows/noetic.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/noetic.yml) +[![ROS2](https://github.com/roslibrust/roslibrust/actions/workflows/ros2.yml/badge.svg)](https://github.com/roslibrust/roslibrust/actions/workflows/ros2.yml) [![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) Documentation about the crate is on [docs.rs](https://docs.rs/roslibrust/latest/roslibrust/), @@ -77,7 +73,7 @@ All of this is backed by common traits for ROS messages, topics, and services. ` `roslibrust_codegen_macro` provides a convenient macro for generating these types: ```rust,ignore -// Will generate types from all packages in ROS_PACKAGE_PATH +// Will generate types from all packages in ROS_PACKAGE_PATH roslibrust_codegen_macro::find_and_generate_ros_messages!(); ``` diff --git a/roslibrust_ros2/src/lib.rs b/roslibrust_ros2/src/lib.rs index b4bbbd13..48019c37 100644 --- a/roslibrust_ros2/src/lib.rs +++ b/roslibrust_ros2/src/lib.rs @@ -360,6 +360,8 @@ mod tests { .unwrap() } + // Ignored for now until we get ROS2 zenoh CI stable + #[ignore] #[tokio::test(flavor = "multi_thread")] async fn test_subscribe_basic() { let ctx = make_test_context();