Skip to content

Test patch

Test patch #412

Workflow file for this run

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the ros2-hkr branch
push:
branches:
- ros2-hkr
pull_request:
branches:
- ros2-hkr
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# This workflow contains a single job called "build"
jobs:
build:
name: Build on ROS2 ${{ matrix.ros_distro }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ros_distro: [rolling, humble, galactic, foxy]
include:
- ros_distro: 'rolling'
os: ubuntu-22.04
- ros_distro: 'humble'
os: ubuntu-22.04
- ros_distro: 'galactic'
os: ubuntu-20.04
- ros_distro: 'foxy'
os: ubuntu-20.04
steps:
- name: Setup ROS2 Workspace
run: |
mkdir -p ${{github.workspace}}/ros2/src
- uses: actions/checkout@v2
with:
path: 'ros2/src/realsense-ros'
- name: Check Copyright & Line-Endings
shell: bash
run: |
cd ${{github.workspace}}/ros2/src/realsense-ros/scripts
./pr_check.sh
# Workaround - forcing cmake 3.23.0 instead of using latest cmake of GHA.
# cmake 3.24.0 is not compaitable with galactic/foxy/humble ament_cmake
# see: https://github.com/ament/ament_cmake/pull/395
# TODO: remove this step once ament_cmake for galactic/foxy/humble is released
- name: Setup cmake 3.23.0
uses: jwlawson/actions-setup-cmake@v1.12.1
with:
cmake-version: '3.23.0'
## If distro is one of [galactic, foxy], use the setup-ros@v0.2
## which supports old versions of ROS2 and EOL versions.
## For Humble distro, use v0.3
## See: 1) https://github.com/ros-tooling/setup-ros#Supported-platforms
## 2) https://github.com/ros-tooling/setup-ros/tree/v0.2#Supported-platforms
- name: build ROS2 Galactic/Foxy
if: ${{ matrix.ros_distro != 'humble' && matrix.ros_distro != 'rolling'}}
uses: ros-tooling/setup-ros@v0.2
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- name: build ROS2 Humble
if: ${{ matrix.ros_distro == 'humble' || matrix.ros_distro == 'rolling' }}
uses: ros-tooling/setup-ros@v0.3
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- name: download private repo
uses: actions/checkout@v2
with:
repository: IntelRealSense/librealsense-private
ref: hkr
- name: Build RealSense SDK 2.0 from source
run: |
cd ${{github.workspace}}
# git clone https://github.com/IntelRealSense/librealsense-private.git -b hkr
cd librealsense-private
sudo mkdir build
cd build
sudo cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=false -DBUILD_GRAPHICAL_EXAMPLES=false
sudo make uninstall
sudo make clean
sudo make -j10
sudo make install
- name: Build
run: |
echo "source /opt/ros/${{ matrix.ros_distro }}/setup.bash" >> ${{github.workspace}}/.bashrc
source ${{github.workspace}}/.bashrc
cd ${{github.workspace}}/ros2
echo "================= ROSDEP UPDATE ====================="
rosdep update --rosdistro ${{ matrix.ros_distro }}
echo "================= ROSDEP INSTALL ===================="
rosdep install -i --reinstall --from-path src --rosdistro ${{ matrix.ros_distro }} --skip-keys=librealsense2 -y
echo "================== COLCON BUILD ======================"
colcon build --cmake-args '-DBUILD_TOOLS=ON'
## This step is commented out since we don't use rosbag files in "Run Tests" step below.
## Please uncomment when "Run Tests" step is fixed to run all tests.
#- name: Download Data For Tests
# run: |
# cd ${{github.workspace}}/ros2
# bag_filename="https://librealsense.intel.com/rs-tests/TestData/outdoors_1color.bag";
# wget $bag_filename -P "records/"
# bag_filename="https://librealsense.intel.com/rs-tests/D435i_Depth_and_IMU_Stands_still.bag";
# wget $bag_filename -P "records/"
- name: Install Packages For Tests
run: |
sudo apt-get install python3-pip
pip3 install numpy --upgrade
pip3 install numpy-quaternion tqdm
- name: Run Tests
run: |
cd ${{github.workspace}}/ros2
source ${{github.workspace}}/.bashrc
. install/local_setup.bash
python3 src/realsense-ros/realsense2_camera/scripts/rs2_test.py non_existent_file