Skip to content

chore: prepare core crates for crates.io publishing #1071

chore: prepare core crates for crates.io publishing

chore: prepare core crates for crates.io publishing #1071

Workflow file for this run

name: Interop Tests
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'book/**'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-preview.yml'
- '.github/workflows/ci.yml'
- '.github/workflows/rmw-zenoh-rs.yml'
- '.github/workflows/semantic-pr.yml'
- '.github/workflows/pr-draft-check.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main]
paths-ignore:
- '**.md'
- 'book/**'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-preview.yml'
- '.github/workflows/ci.yml'
- '.github/workflows/rmw-zenoh-rs.yml'
- '.github/workflows/semantic-pr.yml'
- '.github/workflows/pr-draft-check.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
interop_test:
name: Interop tests with ROS 2 ${{ matrix.distro }}
runs-on: ubuntu-latest
# Skip for draft PRs to save CI time during development
if: |
github.event_name == 'push' ||
github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
distro: [humble, jazzy, kilted, lyrical]
include:
- distro: humble
image: ros:humble-ros-base
hiroz_feature: humble
- distro: jazzy
image: ros:jazzy-ros-base
hiroz_feature: jazzy
- distro: kilted
image: ros:kilted-ros-base
hiroz_feature: kilted
- distro: lyrical
image: ros:lyrical-ros-base
hiroz_feature: lyrical
container:
image: ${{ matrix.image }}
steps:
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ matrix.distro }}-v3-${{ hashFiles('.github/workflows/test.yml') }}
- name: Install system dependencies
run: apt-get update && apt-get install -y nodejs
- name: Install Nushell
run: |
NU_VERSION=0.102.0
ARCH=$(uname -m | sed 's/x86_64/x86_64/;s/aarch64/aarch64/')
NU_TARBALL="nu-${NU_VERSION}-${ARCH}-unknown-linux-gnu"
curl -fsSL "https://github.com/nushell/nushell/releases/download/${NU_VERSION}/${NU_TARBALL}.tar.gz" \
| tar -xz -C /usr/local/bin --strip-components=1 "${NU_TARBALL}/nu"
- name: Install ROS dependencies
run: |
apt-get install -y \
ros-${{ matrix.distro }}-example-interfaces \
ros-${{ matrix.distro }}-rmw-zenoh-cpp \
ros-${{ matrix.distro }}-demo-nodes-cpp \
ros-${{ matrix.distro }}-action-tutorials-cpp \
ros-${{ matrix.distro }}-geometry-msgs \
ros-${{ matrix.distro }}-sensor-msgs \
ros-${{ matrix.distro }}-nav-msgs \
protobuf-compiler
- name: Fix broken rmw_zenoh_cpp config for Kilted
if: matrix.distro == 'kilted'
run: |
# WORKAROUND: ros-kilted-rmw-zenoh-cpp 0.6.6 has invalid transport_optimization field
CONFIG_FILE="/opt/ros/kilted/share/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5"
if grep -q "transport_optimization" "$CONFIG_FILE" 2>/dev/null; then
sed -i '/transport_optimization:/,/},$/d' "$CONFIG_FILE"
echo "Fixed rmw_zenoh_cpp config by removing invalid transport_optimization section"
fi
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.distro }}-interop
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Run interop tests
shell: bash
run: |
source /opt/ros/${{ matrix.distro }}/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
export RUST_LOG=hiroz=debug,zenoh=warn
FEATURES="${{ matrix.hiroz_feature }}"
if [ "$FEATURES" = "humble" ]; then
cargo nextest run -p hiroz-tests --profile interop \
--no-default-features --features ros-interop,humble
else
cargo nextest run -p hiroz-tests --profile interop \
--features "ros-interop,$FEATURES"
cargo nextest run -p hiroz-console --profile interop \
--features ros-interop \
-E 'test(dynamic_subscriber)'
fi
- uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- name: Build Rust FFI library + example binaries
run: |
FEATURES="ffi,${{ matrix.hiroz_feature }},rmw-zenoh"
cargo build --release --no-default-features --features "$FEATURES" \
--lib --example z_pubsub --example z_srvcli --example zenoh_router
- name: Generate Go message types (bundled IDL)
run: |
mkdir -p _tmp crates/hiroz-go/generated
cargo run -p hiroz-codegen --bin export_json -- \
--assets crates/hiroz-codegen/assets/jazzy \
--output _tmp/go-manifest.json \
--packages builtin_interfaces,service_msgs,action_msgs,unique_identifier_msgs,std_msgs,example_interfaces
cd crates/hiroz-codegen-go && go run . \
-input ../../_tmp/go-manifest.json \
-output ../hiroz-go/generated \
-prefix github.com/ZettaScaleLabs/hiroz/crates/hiroz-go
- name: Go vet (static analysis)
run: nu scripts/test-go.nu --vet-only
- name: Run Go integration tests (Go↔Go + Go↔Rust + Go↔ROS2)
shell: bash
run: |
source /opt/ros/${{ matrix.distro }}/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
nu scripts/test-go.nu --integration