Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ devel ]
pull_request:
branches: [ devel ]

env:
ROS_DISTRO: melodic
ROSINSTALL_FILE: $GITHUB_PATH/dependencies.rosinstall
CATKIN_OPTIONS: $GITHUB_PATH/catkin.options
ROS_PARALLEL_JOBS: '-j8 -l6'
# Set the python path manually to include /usr/-/python2.7/dist-packages
# as this is where apt-get installs python packages.
PYTHONPATH: $PYTHONPATH:/usr/lib/python2.7/dist-

jobs:
build:

runs-on: ubuntu-18.04
container: ros:melodic

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# cache: 'npm' unable to cache without package-lock
# Create a catkin workspace with the package under integration.
- name: Initialize workspace
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws
catkin_make
source devel/setup.bash
- name: install message packages
run: |
git clone https://github.com/ros/std_msgs.git src/std_msgs
git clone https://github.com/ros/common_msgs src/common_msgs
git clone https://github.com/RethinkRobotics-opensource/test_msgs.git src/test_msgs
git clone https://github.com/ros/ros_comm_msgs.git src/ros_comm_msgs
# # Install all dependencies, using wstool first and rosdep second.
# # wstool looks for a ROSINSTALL_FILE defined in the environment variables.
# - run: cd ~/catkin_ws/src
# - run: wstool init
# - run: if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
# - run: wstool up
# # package dependencies: install using rosdep.
- name: generate messages and test
run: |
cd ~/catkin_ws
source devel/setup.bash
cd $GITHUB_WORKSPACE
npm install
npm run compile
npm run generate
npm test