Skip to content

Commit

Permalink
reduce ci test matrix to only LTS and latest ROS & Nodejs distros
Browse files Browse the repository at this point in the history
- updated actions:
checkout - v3
setup-node - v3
setup-ros - v0.6

reduce node version matrix:
14, 16, 18, 19

reduce ros version matrix:
foxy, humble, rolling

On windows use explict nodejs version to workaround some silly github
environment issue that is not correctly setting up node-gyp. I think
this is caused by an environment/action caching of a bad instance.

Updated README.md to display the develop branch's compatibility with the
LTS and current ROS branches on Linux and Windows.
  • Loading branch information
wayneparrott committed Feb 28, 2023
1 parent 0ea952f commit d9efef7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 37 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/linux-build-and-test-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.x, 14.X, 16.X, 17.X]
node-version: [14.X, 16.X, 18.X, 19.X]
ros_distribution:
- humble
- rolling

steps:
- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.4
uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -36,19 +36,18 @@ jobs:
npm i
npm test
build-foxy-and-galactic: # foxy and galactic distros
build-foxy: # foxy distros
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.x, 14.X, 16.X, 17.X, 18.X, 19.X]
node-version: [14.X, 16.11.X, 18.X, 19.X]
ros_distribution:
- foxy
- galactic

steps:
- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.4
uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand All @@ -58,7 +57,7 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.X, 19.X]
node-version: [14.X, 16.X, 18.X, 19.X]
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.4
uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/windows-build-and-test-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.12.X, 19.X]
node-version: [14.21.2, 16.19.0, 18.14.2, 19.X]
ros_distribution:
# - foxy
- galactic
- foxy
- humble
- rolling
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.4
uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

Expand All @@ -45,8 +44,11 @@ jobs:
call "c:\dev\${{ matrix.ros_distribution }}\ros2-windows\setup.bat"
npm i
# On the windows/foxy combination the Eclipse CycloneDDS RMW implementation is used to workaround
# an error when loading the default fastrtps ddl
- name: Test rclnodejs
shell: cmd
run: |
call "c:\dev\${{ matrix.ros_distribution }}\ros2-windows\setup.bat"
npm test
cmd /c "if ${{ matrix.ros_distribution }}==foxy (set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp&&npm test)"
cmd /c "if NOT ${{ matrix.ros_distribution }}==foxy (npm test)"
13 changes: 9 additions & 4 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.X, 12.X, 14.X, 16.11.X, 17.X, 18.12.0, 19.X]
# Explicit node versions are used to workaround an error
# where node-gyp fails due to some silly cacheing
node-version: [14.21.2, 16.19.0, 18.14.2, 19.X]
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup ROS2
uses: ros-tooling/setup-ros@v0.4
uses: ros-tooling/setup-ros@v0.6
with:
required-ros-distributions: ${{ needs.identify-ros-distro.outputs.distro }}

Expand All @@ -56,8 +58,11 @@ jobs:
call "c:\dev\${{ needs.identify-ros-distro.outputs.distro }}\ros2-windows\setup.bat"
npm i
# On the windows/foxy combination the Eclipse CycloneDDS RMW implementation is used to workaround
# an error when loading the default fastrtps ddl
- name: Test rclnodejs
shell: cmd
run: |
call "c:\dev\${{ needs.identify-ros-distro.outputs.distro }}\ros2-windows\setup.bat"
npm test
cmd /c "if ${{ needs.identify-ros-distro.outputs.distro }}==foxy (set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp&&npm test)"
cmd /c "if NOT ${{ needs.identify-ros-distro.outputs.distro }}==foxy (npm test)"
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# rclnodejs - ROS2 Client Library for JavaScript [![npm](https://img.shields.io/npm/v/rclnodejs.svg)](https://www.npmjs.com/package/rclnodejs)[![Coverage Status](https://coveralls.io/repos/github/RobotWebTools/rclnodejs/badge.svg?branch=develop)](https://coveralls.io/github/RobotWebTools/rclnodejs?branch=develop)[![npm](https://img.shields.io/npm/dm/rclnodejs)](https://www.npmjs.com/package/rclnodejs)[![GitHub license](https://img.shields.io/github/license/RobotWebTools/rclnodejs.svg)](https://github.com/RobotWebTools/rclnodejs/blob/develop/LICENSE)[![node](https://img.shields.io/node/v/rclnodejs.svg)](https://nodejs.org/en/download/releases/)[![npm type definitions](https://img.shields.io/npm/types/rclnodejs)](https://www.npmjs.com/package/rclnodejs)[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
# rclnodejs - The ROS 2 Client Library for JavaScript

| **BRANCH** | **Linux** | **Windows** |
| :-----------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| develop | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Linux%20Build%20and%20Test) | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Windows%20Build%20&%20Test) |
| humble-hawksbill | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Linux%20Build%20and%20Test/humble-hawksbill) | ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Windows%20Build%20&%20Test/humble-hawksbill) |
| galactic-geochelone | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Linux%20Build%20and%20Compatibility%20Test) | ![GitHub Workflow Status ](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Windows%20Build%20&%20Compatibility%20Test) |
| foxy-fitzroy | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/RobotWebTools/rclnodejs/rclnodejs%20-%20Linux%20Build%20and%20Compatibility%20Test) | ![GitHub Workflow Status](https://img.shields.io/badge/Build-Not%20Available-yellow) |
[![npm](https://img.shields.io/npm/v/rclnodejs.svg)](https://www.npmjs.com/package/rclnodejs)[![Coverage Status](https://coveralls.io/repos/github/RobotWebTools/rclnodejs/badge.svg?branch=develop)](https://coveralls.io/github/RobotWebTools/rclnodejs?branch=develop)[![npm](https://img.shields.io/npm/dm/rclnodejs)](https://www.npmjs.com/package/rclnodejs)[![GitHub license](https://img.shields.io/github/license/RobotWebTools/rclnodejs.svg)](https://github.com/RobotWebTools/rclnodejs/blob/develop/LICENSE)[![node](https://img.shields.io/node/v/rclnodejs.svg)](https://nodejs.org/en/download/releases/)[![npm type definitions](https://img.shields.io/npm/types/rclnodejs)](https://www.npmjs.com/package/rclnodejs)[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

| **ROS Distro\*** | **Linux** | **Windows** |
| :--------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Rolling | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/linux-build-and-test-compatibility.yml?branch=develop) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/windows-build-and-test-compatibility.yml?branch=develop) |
| Humble-Hawksbill | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/linux-build-and-test-compatibility.yml?branch=develop) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/windows-build-and-test-compatibility.yml?branch=develop) |
| Foxy-Fitzroy | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/linux-build-and-test-compatibility.yml?branch=develop) | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/RobotWebTools/rclnodejs/windows-build-and-test-compatibility.yml?branch=develop) |

\* rclnodejs development and maintenance is limited to the ROS 2 LTS releases and the Rolling development branch

**rclnodejs** is a Node.js client library for the Robot Operating System
([ROS 2](https://index.ros.org/doc/ros2/)). It provides a JavaScript API
and tooling for ROS 2 programming. TypeScript declarations, i.e., (\*.d.ts),
are included to support use in TypeScript projects.
([ROS 2](https://index.ros.org/doc/ros2/)). It provides tooling and comprehensive
JavaScript and TypeScript APIs for developing ROS 2 solutions capable of
interoperating with ROS 2 nodes implemented in other languages such as
C++ and Python.

Here's an example for how to create a ROS 2 node that publishes a string message in a few lines of JavaScript.
Here's an example for creating a ROS 2 node that publishes a string message in a few lines of JavaScript.

```JavaScript
const rclnodejs = require('rclnodejs');
Expand Down Expand Up @@ -63,11 +67,6 @@ To install a specific version of rclnodejs use:
npm i [email protected]
```

| RCLNODEJS Version | Compatible ROS 2 Release |
| :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [0.21.4 (current)](https://www.npmjs.com/package/rclnodejs/v/0.21.4) ([API](http://robotwebtools.org/rclnodejs/docs/0.21.3/index.html)) | [Humble Hawksbill](https://github.com/ros2/ros2/releases/tag/release-humble-20220523)<br>[Galactic Geochelone](https://github.com/ros2/ros2/releases/tag/release-galactic-20210716)<br>[Foxy Fitzroy](https://github.com/ros2/ros2/releases/tag/release-foxy-20201211)<br>[Eloquent Elusor](https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124) |
| [0.10.3](https://github.com/RobotWebTools/rclnodejs/releases/tag/0.10.3) | [Dashing Diademata - Patch 4](https://github.com/ros2/ros2/releases/tag/release-dashing-20191018) |

- **Note:** to install rclnodejs from GitHub: add `"rclnodejs":"RobotWebTools/rclnodejs#<branch>"` to your `package.json` depdendency section.

## rclnodejs-cli
Expand Down
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rosidl_typesupport_interface/ ') + '/include/rosidl_typesupport_interface/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_action/ ') + '/include/rcl_action/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/action_msgs/ ') + '/include/action_msgs/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/service_msgs/ ') + '/include/service_msgs/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/unique_identifier_msgs/ ') + '/include/unique_identifier_msgs/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/builtin_interfaces/ ') + '/include/builtin_interfaces/')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/:/g, '/include/rcl_lifecycle/ ') + '/include/rcl_lifecycle/')\")",
Expand Down Expand Up @@ -129,6 +130,7 @@
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rosidl_typesupport_interface ').replace(/\\\/g, '/') + '/include/rosidl_typesupport_interface')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_action ').replace(/\\\/g, '/') + '/include/rcl_action')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/action_msgs ').replace(/\\\/g, '/') + '/include/action_msgs')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/service_msgs ').replace(/\\\/g, '/') + '/include/service_msgs')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/unique_identifier_msgs ').replace(/\\\/g, '/') + '/include/unique_identifier_msgs')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/builtin_interfaces ').replace(/\\\/g, '/') + '/include/builtin_interfaces')\")",
"<!@(node -e \"console.log(process.env.AMENT_PREFIX_PATH.replace(/;/g, '/include/rcl_lifecycle ').replace(/\\\/g, '/') + '/include/rcl_lifecycle')\")",
Expand Down

0 comments on commit d9efef7

Please sign in to comment.