diff --git a/.github/workflows/linux-arm64-build-and-test.yml b/.github/workflows/linux-arm64-build-and-test.yml index 98a3cfe0..f8fa25c0 100644 --- a/.github/workflows/linux-arm64-build-and-test.yml +++ b/.github/workflows/linux-arm64-build-and-test.yml @@ -1,19 +1,12 @@ -name: Linux arm64 +name: Linux ARM64 Build and Test (Reusable) on: - push: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - pull_request: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - workflow_dispatch: + workflow_call: + inputs: + trigger_type: + description: 'Type of trigger (pr or push)' + required: true + type: string defaults: run: diff --git a/.github/workflows/linux-arm64-pr-test.yml b/.github/workflows/linux-arm64-pr-test.yml new file mode 100644 index 00000000..36234453 --- /dev/null +++ b/.github/workflows/linux-arm64-pr-test.yml @@ -0,0 +1,17 @@ +name: Linux ARM64 - Pull Request + +on: + pull_request: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/linux-arm64-build-and-test.yml + with: + trigger_type: "pr" + secrets: inherit diff --git a/.github/workflows/linux-arm64-push-test.yml b/.github/workflows/linux-arm64-push-test.yml new file mode 100644 index 00000000..277b3fa9 --- /dev/null +++ b/.github/workflows/linux-arm64-push-test.yml @@ -0,0 +1,17 @@ +name: Linux ARM64 - Push to Branches + +on: + push: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/linux-arm64-build-and-test.yml + with: + trigger_type: "push" + secrets: inherit diff --git a/.github/workflows/linux-build-and-test-compatibility.yml b/.github/workflows/linux-build-and-test-compatibility.yml deleted file mode 100644 index 7bc008a8..00000000 --- a/.github/workflows/linux-build-and-test-compatibility.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Linux Build & Compatibility Test - -on: - workflow_dispatch: - -jobs: - build-humble-and-rolling: # jazzy, humble and rolling distros - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - node-version: [20.X, 22.X] - ros_distribution: - - kilted - - jazzy - - humble - - rolling - - steps: - - name: Setup ROS2 - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: ${{ matrix.ros_distribution }} - - - name: Install test-msgs on Linux - run: | - sudo apt install ros-${{ matrix.ros_distribution }}-test-msgs - - uses: actions/checkout@v4 - - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Build and test rclnodejs - run: | - source /opt/ros/${{ matrix.ros_distribution }}/setup.bash - npm i - npm run lint - npm test diff --git a/.github/workflows/linux-x64-build-and-test.yml b/.github/workflows/linux-x64-build-and-test.yml index 1095ae0b..d74456d5 100644 --- a/.github/workflows/linux-x64-build-and-test.yml +++ b/.github/workflows/linux-x64-build-and-test.yml @@ -1,19 +1,12 @@ -name: Linux x64 +name: Build and Test (Reusable) on: - push: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - pull_request: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - workflow_dispatch: + workflow_call: + inputs: + trigger_type: + description: 'Type of trigger (pr or push)' + required: true + type: string defaults: run: @@ -83,14 +76,16 @@ jobs: npm run clean - name: Coveralls Parallel + if: ${{ matrix.ros_distribution == 'rolling' && matrix['node-version'] == '24.X' }} uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - flag-name: run-${{ matrix.node-version }}-${{ matrix.architecture }} + flag-name: run-${{ inputs.trigger_type }}-${{ matrix.node-version }}-${{ matrix.architecture }} parallel: true finish: needs: build + if: always() runs-on: ubuntu-latest steps: - name: Coveralls Finished diff --git a/.github/workflows/linux-x64-pr-test.yml b/.github/workflows/linux-x64-pr-test.yml new file mode 100644 index 00000000..62c4dc6a --- /dev/null +++ b/.github/workflows/linux-x64-pr-test.yml @@ -0,0 +1,17 @@ +name: Linux x64 - Pull Request + +on: + pull_request: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/linux-x64-build-and-test.yml + with: + trigger_type: "pr" + secrets: inherit diff --git a/.github/workflows/linux-x64-push-test.yml b/.github/workflows/linux-x64-push-test.yml new file mode 100644 index 00000000..258df36d --- /dev/null +++ b/.github/workflows/linux-x64-push-test.yml @@ -0,0 +1,17 @@ +name: Linux x64 - Push to Branches + +on: + push: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/linux-x64-build-and-test.yml + with: + trigger_type: "push" + secrets: inherit diff --git a/.github/workflows/windows-build-and-test-compatibility.yml b/.github/workflows/windows-build-and-test-compatibility.yml deleted file mode 100644 index a2bb0f0c..00000000 --- a/.github/workflows/windows-build-and-test-compatibility.yml +++ /dev/null @@ -1,55 +0,0 @@ - -name: Windows Build & Compatibility Test - -on: - workflow_dispatch: - -jobs: - build: - runs-on: windows-2025 - strategy: - fail-fast: false - matrix: - node-version: [22.X] - ros_distribution: - - kilted - - jazzy - - humble - - rolling - steps: - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Setup ROS2 - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: ${{ matrix.ros_distribution }} - - - name: Install ROS2 Rolling (Conditional) - if: ${{ matrix.ros_distribution == 'rolling' }} - shell: bash - run: | - wget --quiet https://ci.ros2.org/view/packaging/job/packaging_windows/lastSuccessfulBuild/artifact/ws/ros2-package-windows-AMD64.zip -O rolling.zip - 7z x rolling.zip -y -o/c/dev/rolling - - - name: Prebuild - Setup VS Dev Environment - uses: seanmiddleditch/gha-setup-vsdevenv@v4 - - - uses: actions/checkout@v4 - - - name: Build rclnodejs - shell: cmd - run: | - 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" - 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)" diff --git a/.github/workflows/windows-build-and-test.yml b/.github/workflows/windows-build-and-test.yml index debd2322..e68564fc 100644 --- a/.github/workflows/windows-build-and-test.yml +++ b/.github/workflows/windows-build-and-test.yml @@ -1,19 +1,12 @@ -name: Windows +name: Windows Build and Test (Reusable) on: - push: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - pull_request: - branches: - - develop - - kilted - - jazzy - - humble-hawksbill - workflow_dispatch: + workflow_call: + inputs: + trigger_type: + description: 'Type of trigger (pr or push)' + required: true + type: string jobs: build: @@ -57,7 +50,7 @@ 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 + # 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 diff --git a/.github/workflows/windows-pr-test.yml b/.github/workflows/windows-pr-test.yml new file mode 100644 index 00000000..f0139774 --- /dev/null +++ b/.github/workflows/windows-pr-test.yml @@ -0,0 +1,17 @@ +name: Windows - Pull Request + +on: + pull_request: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/windows-build-and-test.yml + with: + trigger_type: "pr" + secrets: inherit diff --git a/.github/workflows/windows-push-test.yml b/.github/workflows/windows-push-test.yml new file mode 100644 index 00000000..e7efdec1 --- /dev/null +++ b/.github/workflows/windows-push-test.yml @@ -0,0 +1,17 @@ +name: Windows - Push to Branches + +on: + push: + branches: + - develop + - kilted + - jazzy + - humble-hawksbill + workflow_dispatch: + +jobs: + build-and-test: + uses: ./.github/workflows/windows-build-and-test.yml + with: + trigger_type: "push" + secrets: inherit diff --git a/README.md b/README.md index d6f85f71..40fa7c1d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![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\*** | **Status** | -| :----------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| Rolling
Kilted
Jazzy
Humble | [![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-build-and-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-build-and-test.yml?query=branch%3Adevelop)
[![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-build-and-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-build-and-test.yml?query=branch%3Adevelop)
[![Windows](https://github.com/RobotWebTools/rclnodejs/actions/workflows/windows-build-and-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/windows-build-and-test.yml?query=branch%3Adevelop) | +| **ROS Distro\*** | **Status** | +| :----------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| Rolling
Kilted
Jazzy
Humble | [![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-push-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-push-test.yml?query=branch%3Adevelop)
[![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-push-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-push-test.yml?query=branch%3Adevelop)
[![Windows](https://github.com/RobotWebTools/rclnodejs/actions/workflows/windows-push-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/windows-push-test.yml?query=branch%3Adevelop) | \* rclnodejs development and maintenance is limited to the ROS 2 LTS releases and the Rolling development branch diff --git a/scripts/npmjs-readme.md b/scripts/npmjs-readme.md index b4d1df3e..03646987 100644 --- a/scripts/npmjs-readme.md +++ b/scripts/npmjs-readme.md @@ -1,4 +1,4 @@ -# rclnodejs [![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-build-and-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-build-and-test.yml?query=branch%3Adevelop)[![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-build-and-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-build-and-test.yml?query=branch%3Adevelop) +# rclnodejs [![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-push-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-x64-push-test.yml?query=branch%3Adevelop)[![Linux](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-push-test.yml/badge.svg?branch=develop)](https://github.com/RobotWebTools/rclnodejs/actions/workflows/linux-arm64-push-test.yml?query=branch%3Adevelop) `rclnodejs` is a Node.js client for the Robot Operating System (ROS 2). It provides a simple and easy JavaScript API for ROS 2 programming. TypeScript declarations are included to support use of rclnodejs in TypeScript projects.