From c3c71db6d45868dfe4a94b1692133fdff979233e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 21:50:46 -0400 Subject: [PATCH 01/11] Create node.js.yml --- .github/workflows/node.js.yml | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..0d3ba38 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,68 @@ +# 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 + CI_SOURCE_PATH: $(pwd) + 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: bionic + container: melodic-ros-core + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + 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' + # Create a catkin workspace with the package under integration. + - run: mkdir -p ~/catkin_ws/src + - run: cd ~/catkin_ws/src + - run: catkin_init_workspace + # Create the devel/setup.bash (run catkin_make with an empty workspace) and + # source it to set the path variables. + - run: cd ~/catkin_ws + - run: catkin_make + - run: source devel/setup.bash + # Install required message packages + - run: git clone https://github.com/ros/std_msgs.git src/std_msgs + - run: git clone https://github.com/ros/common_msgs src/common_msgs + - run: git clone https://github.com/RethinkRobotics-opensource/test_msgs.git src/test_msgs + - run: 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. + - run: cd ~/catkin_ws + - run: rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO + - run: source devel/setup.bash + - run: cd $CI_SOURCE_PATH + - run: npm install + - run: npm run compile + - run: npm run generate + - run: npm test From 5c36fb913b56af42bdf7cb2c827410133a0cdc4e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 21:56:52 -0400 Subject: [PATCH 02/11] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0d3ba38..532345b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -22,7 +22,7 @@ env: jobs: build: - runs-on: bionic + runs-on: ubuntu-18.04 container: melodic-ros-core strategy: From a569060a51833de429ac93f34c751654bb5774ba Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:01:12 -0400 Subject: [PATCH 03/11] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 532345b..8b494b0 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -23,7 +23,7 @@ jobs: build: runs-on: ubuntu-18.04 - container: melodic-ros-core + container: ros:melodic-ros-core strategy: matrix: From 5ef510378be0765da1b0a4191ec67456969d491b Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:07:46 -0400 Subject: [PATCH 04/11] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 8b494b0..2a05b6d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -36,7 +36,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'npm' + # cache: 'npm' unable to cache without package-lock # Create a catkin workspace with the package under integration. - run: mkdir -p ~/catkin_ws/src - run: cd ~/catkin_ws/src From ed560634c93459da77c9dfd60b3057ed78e86447 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:10:01 -0400 Subject: [PATCH 05/11] Update node.js.yml --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2a05b6d..48d454b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -40,6 +40,7 @@ jobs: # Create a catkin workspace with the package under integration. - run: mkdir -p ~/catkin_ws/src - run: cd ~/catkin_ws/src + - run: source /opt/ros/$ROS_DISTRO/setup.bash - run: catkin_init_workspace # Create the devel/setup.bash (run catkin_make with an empty workspace) and # source it to set the path variables. From 94cf46bdb2e599decf8a8fb0b1268e3f35056187 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:16:09 -0400 Subject: [PATCH 06/11] Update node.js.yml --- .github/workflows/node.js.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 48d454b..cd87a8a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -30,6 +30,10 @@ jobs: node-version: [10.x, 12.x, 14.x, 16.x, 18.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 }} From cc22410b7246ac27006068bbf6b3a0dd19166fa4 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:18:06 -0400 Subject: [PATCH 07/11] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cd87a8a..6940c40 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -23,7 +23,7 @@ jobs: build: runs-on: ubuntu-18.04 - container: ros:melodic-ros-core + container: ros:melodic strategy: matrix: From 0c5375f1949b2cc266ed3f9fe12ef782b2a5594c Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:20:27 -0400 Subject: [PATCH 08/11] Update node.js.yml --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6940c40..32915d1 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -42,6 +42,7 @@ jobs: node-version: ${{ matrix.node-version }} # cache: 'npm' unable to cache without package-lock # Create a catkin workspace with the package under integration. + - run: sudo apt-get install python-catkin-tools - run: mkdir -p ~/catkin_ws/src - run: cd ~/catkin_ws/src - run: source /opt/ros/$ROS_DISTRO/setup.bash From 170714af0b15849ff1493afc383084e74a850c03 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Mar 2022 22:22:09 -0400 Subject: [PATCH 09/11] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 32915d1..6aad17c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 16.x, 18.x] + node-version: [10.x, 12.x, 14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ defaults: From fdc4a72298bab33b19c2ed612f605a4fa0831eab Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 3 Apr 2022 22:13:06 -0400 Subject: [PATCH 10/11] Update node.js.yml --- .github/workflows/node.js.yml | 61 ++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6aad17c..b18a591 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -42,33 +42,34 @@ jobs: node-version: ${{ matrix.node-version }} # cache: 'npm' unable to cache without package-lock # Create a catkin workspace with the package under integration. - - run: sudo apt-get install python-catkin-tools - - run: mkdir -p ~/catkin_ws/src - - run: cd ~/catkin_ws/src - - run: source /opt/ros/$ROS_DISTRO/setup.bash - - run: catkin_init_workspace - # Create the devel/setup.bash (run catkin_make with an empty workspace) and - # source it to set the path variables. - - run: cd ~/catkin_ws - - run: catkin_make - - run: source devel/setup.bash - # Install required message packages - - run: git clone https://github.com/ros/std_msgs.git src/std_msgs - - run: git clone https://github.com/ros/common_msgs src/common_msgs - - run: git clone https://github.com/RethinkRobotics-opensource/test_msgs.git src/test_msgs - - run: 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. - - run: cd ~/catkin_ws - - run: rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO - - run: source devel/setup.bash - - run: cd $CI_SOURCE_PATH - - run: npm install - - run: npm run compile - - run: npm run generate - - run: npm test + - 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 $CI_SOURCE_PATH + npm install + npm run compile + npm run generate + npm test From 18ed30bd1ba69b68b4b2b6525e361b92e0a6111d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 3 Apr 2022 22:17:00 -0400 Subject: [PATCH 11/11] Update node.js.yml --- .github/workflows/node.js.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b18a591..3a1b1a5 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,7 +11,6 @@ on: env: ROS_DISTRO: melodic - CI_SOURCE_PATH: $(pwd) ROSINSTALL_FILE: $GITHUB_PATH/dependencies.rosinstall CATKIN_OPTIONS: $GITHUB_PATH/catkin.options ROS_PARALLEL_JOBS: '-j8 -l6' @@ -68,7 +67,7 @@ jobs: run: | cd ~/catkin_ws source devel/setup.bash - cd $CI_SOURCE_PATH + cd $GITHUB_WORKSPACE npm install npm run compile npm run generate