-
Notifications
You must be signed in to change notification settings - Fork 22
162 lines (145 loc) · 5.81 KB
/
Copy pathtest.yml
File metadata and controls
162 lines (145 loc) · 5.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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