Skip to content

Build and import properly #2404

Build and import properly

Build and import properly #2404

Workflow file for this run

name: Continuous Integration (SDK)
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
push:
branches:
- '**'
pull_request:
- 'develop'
- 'main'
tags:
- '\d+.\d.+\d+*'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
ba_linux:
name: "General Software Linux"
runs-on: ubuntu-latest
# if: false # disable this job
defaults:
run:
working-directory: scripts
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
# token: ${{ secrets.ALL_REPO_PAT }}
submodules: recursive
fetch-depth: 0 # Fetches full commit history, needed for repo info steps in build
- name: Install dependencies
run: |
./install_sdk_dependencies.sh
./install_gtest.sh
- name: Clean All
run: ./clean_all.sh
- name: Build SDK
run: ./build_is_sdk.sh
- name: Build Unit Tests
run: ./build_unit_tests.sh
- name: Run Unit Tests
run: ./build_unit_tests.sh --nobuild --test
- name: Build cltool
run: ./build_cltool.sh
- name: Build LogInspector
run: |
./install_log_inspector_dependencies.sh
./build_log_inspector.sh
- name: Build SDK Examples
run: python3 build_manager.py SDK_Examples ../ExampleProjects
ba_windows:
name: "General Software Windows"
runs-on: [self-hosted, windows, x64]
# if: false # disable this job
# if: (github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/develop') # Only run job on these branches
defaults:
run:
working-directory: scripts/windows
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
# token: ${{ secrets.ALL_REPO_PAT }}
submodules: recursive
fetch-depth: 0 # Fetches full commit history, needed for repo info steps in build
- name: Clean all
run: ./clean_all.bat
- name: Build IS SDK library
run: ./build_is_sdk.bat
- name: Build Unit Tests
run: ./build_unit_tests.bat
- name: Build CLTool
run: ./build_cltool.bat
- name: Build LogInspector
run: ./build_log_inspector.bat
- name: Build SDK Examples
run: ./build_sdk_examples.bat
ros1-bridge-tests:
name: "ROS1 Bridge Tests"
runs-on: [self-hosted, Linux, X64, docker, focal]
# if: false # disable this job
env:
ROS_CI_DESKTOP: "`lsb_release -cs`" # e.g. [trusty|xenial|...]
ROS_DISTRO: noetic
container:
image: ros:noetic
#options: --privileged -v /dev:/dev
options: --device-cgroup-rule="c 166:* rmw"
volumes:
- "/dev:/dev"
defaults:
run:
working-directory: ../ROS/catkin_ws
shell: bash
steps:
- name: Update Git & CMake versions
working-directory: .
run: |
echo "::group::Install software-properties-common and dependencies."
apt-get update && apt -y install software-properties-common dirmngr apt-transport-https lsb-release ca-certificates libyaml-cpp-dev gpg wget curl
echo "::endgroup::"
echo "::group::Configure git-core PPA and install latest."
add-apt-repository ppa:git-core/ppa -y && apt -y install git
echo "::endgroup::"
git --version
echo "::group::Configure Kitware CMake PPA and install latest."
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ `lsb_release -sc` main" | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
rm /usr/share/keyrings/kitware-archive-keyring.gpg
apt-get -y install kitware-archive-keyring cmake
echo "::endgroup::"
cmake --version
- name: Checkout source and submodules
uses: actions/checkout@v4
with:
# token: ${{ secrets.ALL_REPO_PAT }}
fetch-depth: 0 # Fetches full commit history, needed for repo info steps in build
submodules: recursive
- name: Install dependencies
working-directory: scripts
run: |
apt-get update && apt-get -y install python3-pip python3-venv python3-git python3-semver
./install_sdk_dependencies.sh
./install_python_dependencies.sh
./install_gtest.sh
- name: Setup ROS environment
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
echo "::group::Install ROS packages."
apt -y install ros-${ROS_DISTRO}-tf libusb-1.0-0-dev
echo "::endgroup::"
git config --global --add safe.directory /__w/inertial-sense-sdk/inertial-sense-sdk
- name: Setup Catkin Workspace and Build
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
catkin_make -DCATKIN_BLACKLIST_PACKAGES="inertial_sense_ros2"
catkin_make test_unit_tests
catkin_make test_ros_bridge
- name: Run Unit Tests
run: |
source devel/setup.bash
rm -rf build/test_results
roscore &
catkin_make run_tests_inertial_sense_ros_gtest_test_unit_tests
catkin_test_results
pkill roscore
- name: Run Functional/Integration Tests (via hardware)
run: |
source devel/setup.bash
roscore &
catkin_make run_tests_inertial_sense_ros_gtest_test_ros_bridge
catkin_test_results
ros2-bridge-tests:
name: "ROS2 Bridge Tests"
runs-on: [self-hosted, Linux, X64, docker, focal]
# if: false # disable this job
container:
image: osrf/ros:jazzy-desktop
options: --device-cgroup-rule="c 166:* rmw"
volumes:
- "/dev:/dev"
defaults:
run:
working-directory: ../ROS/ros2_ws # This is outside the scope of git
shell: bash
steps:
- name: Update Git & CMake versions
working-directory: .
run: |
echo "::group::Install software-properties-common and dependencies."
apt-get update && apt -y install software-properties-common dirmngr apt-transport-https lsb-release ca-certificates libyaml-cpp-dev gpg wget curl
echo "::endgroup::"
echo "::group::Configure git-core PPA and install latest."
add-apt-repository ppa:git-core/ppa -y && apt -y install git
echo "::endgroup::"
git --version
echo "::group::Configure Kitware CMake PPA and install latest."
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ `lsb_release -sc` main" | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
rm /usr/share/keyrings/kitware-archive-keyring.gpg
apt-get -y install kitware-archive-keyring cmake
echo "::endgroup::"
cmake --version
- name: Install libboost and other pre-checkout dependencies
run: |
/ros_entrypoint.sh /bin/bash -e -c "
mkdir -p .cache/pip
apt-get update && apt-get -y install libboost-all-dev python3-pip python3-venv python3-git python3-semver
rm -rf ../../inertial-sense-sdk/* log/ build/ install/ &>/dev/null || true
"
- name: Checkout source and submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetches full commit history, needed for repo info steps in build
- name: Install dependencies
working-directory: scripts
run: |
/ros_entrypoint.sh /bin/bash -e -c "
cd ../../inertial-sense-sdk/scripts
./install_sdk_dependencies.sh
./install_python_dependencies.sh
./install_gtest.sh
chown -R 1003:1003 ../../
"
# - name: Install dependencies
# run: |
# /ros_entrypoint.sh /bin/bash -e -c "
# ../../inertial-sense-sdk/scripts/install_python_dependencies.sh
# "
- name: Build IS SDK library
run: |
/ros_entrypoint.sh /bin/bash -e -c "
git config --global --add safe.directory /__w/inertial-sense-sdk/inertial-sense-sdk
../../inertial-sense-sdk/scripts/build_is_sdk.sh
"
- name: Build ROS2 bridge
run: |
/ros_entrypoint.sh /bin/bash -e -c "
git config --global --add safe.directory /__w/inertial-sense-sdk/inertial-sense-sdk
colcon build
"
- name: Run Functional/Integration Tests (via hardware)
run: |
/ros_entrypoint.sh /bin/bash -e -c "
source install/setup.bash
ros2 run inertial_sense_ros2 test_inertial_sense_ros2
"