mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
Merge branch 'master' of github.com:introlab/rtabmap into kilted-devel
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
name: android
|
||||
|
||||
# Android build environments (docker/noble/android/rtabmap_apiXX).
|
||||
# amd64 only, so a single native runner and no manifest juggling.
|
||||
# Note: these build FROM introlab3it/rtabmap:android-noble-deps, which is not
|
||||
# produced by any workflow; it is still built and pushed by hand.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths: &android_paths
|
||||
# What an Android build actually compiles: CMakeLists.txt adds only
|
||||
# utilite, corelib and app under IF(ANDROID), and rtabmap.bash builds with
|
||||
# WITH_OPENGV=OFF, BUILD_EXAMPLES=OFF, BUILD_TOOLS=OFF.
|
||||
- 'CMakeLists.txt'
|
||||
- 'Version.h.in'
|
||||
- 'RTABMapConfig.cmake.in'
|
||||
- 'cmake_uninstall.cmake.in'
|
||||
- 'cmake_modules/**'
|
||||
- 'utilite/**'
|
||||
- 'corelib/**'
|
||||
- 'app/**'
|
||||
- 'docker/noble/android/**'
|
||||
- '.github/workflows/android.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
paths: *android_paths
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
# A manual dispatch is honored only on master, the only ref we push from.
|
||||
if: ${{ github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/master' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_tag: [android23, android24, android26, android30]
|
||||
include:
|
||||
- docker_tag: android23
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android23
|
||||
introlab3it/rtabmap:tango
|
||||
api_version: 23
|
||||
- docker_tag: android24
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android24
|
||||
api_version: 24
|
||||
- docker_tag: android26
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android26
|
||||
api_version: 26
|
||||
- docker_tag: android30
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android30
|
||||
api_version: 30
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to DockerHub
|
||||
# Only needed when pushing; skipped on pull requests (secrets are
|
||||
# unavailable for fork PRs and we don't push there anyway).
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
platforms: linux/amd64
|
||||
file: ./docker/noble/android/rtabmap_apiXX/Dockerfile
|
||||
build-args: |
|
||||
API_VERSION=${{ matrix.api_version }}
|
||||
tags: ${{ matrix.docker_tags }}
|
||||
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_tag }}
|
||||
cache-to: type=inline
|
||||
@@ -4,9 +4,17 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
@@ -19,36 +27,129 @@ jobs:
|
||||
build:
|
||||
name: ${{ matrix.build_name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.build_name }}
|
||||
cancel-in-progress: true
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
build_name: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-with-opengv, ubuntu-26.04]
|
||||
include:
|
||||
# GTSAM is in no Ubuntu release, and libg2o-dev only appears in the
|
||||
# archive from noble on (jammy has no g2o at all).
|
||||
#
|
||||
# 26.04 builds GTSAM itself (gtsam_ref) rather than taking it from the
|
||||
# ROS repo: that runner is on Ubuntu's amd64v3 variant, so rtabmap and
|
||||
# the archive libraries are AVX builds where Eigen aligns to 32, while
|
||||
# the ROS binary is plain x86-64 where it aligns to 16 and uses plain
|
||||
# malloc/free. Allocating on one side and freeing on the other gives
|
||||
# "double free or corruption (out)". Forcing EIGEN_MAX_ALIGN_BYTES=16
|
||||
# on rtabmap would only move the mismatch onto PCL, g2o and Ceres.
|
||||
- build_name: ubuntu-22.04
|
||||
os: ubuntu-22.04
|
||||
extra_deps: "libunwind-dev libceres-dev"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON"
|
||||
ros_deps: "ros-humble-libg2o ros-humble-gtsam"
|
||||
ros_prefix: "/opt/ros/humble"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DWITH_G2O=ON -DWITH_GTSAM=ON"
|
||||
- build_name: ubuntu-24.04
|
||||
os: ubuntu-24.04
|
||||
extra_deps: "libg2o-dev libceres-dev"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON"
|
||||
ros_deps: "ros-jazzy-gtsam"
|
||||
ros_prefix: "/opt/ros/jazzy"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DWITH_G2O=ON -DWITH_GTSAM=ON"
|
||||
- build_name: ubuntu-24.04-with-opengv
|
||||
os: ubuntu-24.04
|
||||
extra_deps: "libg2o-dev libceres-dev"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DBUILD_OPENGV=ON"
|
||||
ros_deps: "ros-jazzy-gtsam"
|
||||
ros_prefix: "/opt/ros/jazzy"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DWITH_G2O=ON -DWITH_GTSAM=ON -DBUILD_OPENGV=ON"
|
||||
- build_name: ubuntu-26.04
|
||||
os: ubuntu-26.04
|
||||
extra_deps: "libg2o-dev libceres-dev"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DBUILD_OPENGV=ON"
|
||||
# libboost-all-dev for the GTSAM build
|
||||
extra_deps: "libg2o-dev libceres-dev libboost-all-dev"
|
||||
ros_deps: ""
|
||||
ros_prefix: ""
|
||||
# The tag ros-lyrical-gtsam 4.3.0 is built from
|
||||
gtsam_ref: "4.3a0-ros"
|
||||
extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=ON -DWITH_G2O=ON -DWITH_GTSAM=ON -DBUILD_OPENGV=ON"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restore test data
|
||||
id: cache-testdata
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# SQLite DBs are binary-portable -> share the cache across
|
||||
# linux / macos / windows. Key omits runner.os on purpose so all
|
||||
# three OSes hit the same entry.
|
||||
path: data/tests/*.db
|
||||
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
|
||||
|
||||
- name: Fetch test data
|
||||
if: steps.cache-testdata.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: bash scripts/fetch_test_data.sh
|
||||
|
||||
- name: Install Linux Dependencies
|
||||
run: |
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libopencv-dev libpcl-dev git cmake software-properties-common libyaml-cpp-dev ${{ matrix.extra_deps }}
|
||||
sudo apt-get -y install libopencv-dev libpcl-dev git cmake software-properties-common libyaml-cpp-dev curl gnupg lsb-release ${{ matrix.extra_deps }}
|
||||
|
||||
- name: Install Graph Optimizers From The ROS Repo
|
||||
if: matrix.ros_deps != ''
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
|
||||
-o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
|
||||
| sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{ matrix.ros_deps }}
|
||||
|
||||
# The compiler's x86-64 baseline, for the cache key: it decides Eigen's
|
||||
# alignment, so a GTSAM built under one must not be restored under the
|
||||
# other. v3 packages still declare Architecture: amd64, so dpkg cannot tell.
|
||||
- name: Toolchain baseline
|
||||
if: matrix.gtsam_ref != ''
|
||||
id: toolchain
|
||||
run: |
|
||||
avx=$(echo | gcc -dM -E -x c++ - | grep -c __AVX__ || true)
|
||||
echo "gcc $(gcc -dumpversion), __AVX__=$avx"
|
||||
echo "id=gcc$(gcc -dumpversion)-avx${avx}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Restore GTSAM
|
||||
if: matrix.gtsam_ref != ''
|
||||
id: cache-gtsam
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{github.workspace}}/gtsam-install
|
||||
key: gtsam-${{ matrix.gtsam_ref }}-${{ matrix.os }}-${{ steps.toolchain.outputs.id }}
|
||||
|
||||
- name: Build GTSAM
|
||||
if: matrix.gtsam_ref != '' && steps.cache-gtsam.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone --depth 1 --branch ${{ matrix.gtsam_ref }} https://github.com/borglab/gtsam.git ${{runner.temp}}/gtsam-src
|
||||
# Tag-specific fixes, named after the tag.
|
||||
patch_file="${{github.workspace}}/patches/gtsam_$(echo '${{ matrix.gtsam_ref }}' | tr '.' '_').patch"
|
||||
if [ -f "$patch_file" ]; then
|
||||
echo "Applying $patch_file"
|
||||
git -C ${{runner.temp}}/gtsam-src apply "$patch_file"
|
||||
fi
|
||||
cmake -S ${{runner.temp}}/gtsam-src -B ${{runner.temp}}/gtsam-build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/gtsam-install \
|
||||
-DGTSAM_USE_SYSTEM_EIGEN=ON \
|
||||
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
|
||||
-DGTSAM_BUILD_WITH_WERROR=OFF \
|
||||
-DGTSAM_BUILD_TESTS=OFF \
|
||||
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
|
||||
-DGTSAM_BUILD_UNSTABLE=OFF \
|
||||
-DGTSAM_BUILD_PYTHON=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
cmake --build ${{runner.temp}}/gtsam-build --target install -j $(nproc)
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
@@ -62,7 +163,12 @@ jobs:
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPython3_EXECUTABLE=$(which python3) -Dpybind11_DIR=$(python3 -m pybind11 --cmakedir) ${{ matrix.extra_cmake_def }}
|
||||
# Both prefixes when a job has both.
|
||||
prefix_path="${{ matrix.ros_prefix }}"
|
||||
if [ -d "${{github.workspace}}/gtsam-install" ]; then
|
||||
prefix_path="${prefix_path:+$prefix_path;}${{github.workspace}}/gtsam-install"
|
||||
fi
|
||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH="$prefix_path" -DPython3_EXECUTABLE=$(which python3) -Dpybind11_DIR=$(python3 -m pybind11 --cmakedir) ${{ matrix.extra_cmake_def }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
@@ -70,11 +176,46 @@ jobs:
|
||||
- name: Info
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: |
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{ matrix.ros_prefix }}"
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{github.workspace}}/gtsam-install"
|
||||
./rtabmap-console --version
|
||||
|
||||
# - name: Test
|
||||
# working-directory: ${{github.workspace}}/build
|
||||
# # Execute tests defined by the CMake configuration.
|
||||
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
# run: ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
# PYTHONNOUSERSITE=1: prevent the embedded Python interpreter from
|
||||
# loading numpy / other site-packages from ~/.local that were compiled
|
||||
# against a different ABI than the build-time Python (causes numpy
|
||||
# 1.x/2.x mismatch crashes in test_pydetector / test_pydescriptor /
|
||||
# test_pymatcher).
|
||||
env:
|
||||
PYTHONNOUSERSITE: 1
|
||||
run: |
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{ matrix.ros_prefix }}"
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{github.workspace}}/gtsam-install"
|
||||
# Keep a core file per crashing test, for the backtrace step below: an
|
||||
# abort otherwise leaves only its message, and may not reproduce
|
||||
# elsewhere.
|
||||
ulimit -c unlimited
|
||||
sudo sysctl -w kernel.core_pattern="${{github.workspace}}/build/core.%e.%p" > /dev/null
|
||||
ctest -C ${{env.BUILD_TYPE}} -V -LE performance
|
||||
|
||||
- name: Backtrace of crashed tests
|
||||
if: failure()
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
cores=(core.*)
|
||||
if [ ${#cores[@]} -eq 0 ]; then
|
||||
echo "No core file: the failure was an assertion or a wrong value, not a crash."
|
||||
exit 0
|
||||
fi
|
||||
sudo apt-get -y install gdb
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{ matrix.ros_prefix }}"
|
||||
source ${{github.workspace}}/.github/scripts/ros-deps-env.sh "${{github.workspace}}/gtsam-install"
|
||||
for core in "${cores[@]}"; do
|
||||
exe="${core#core.}"
|
||||
exe="bin/${exe%.*}"
|
||||
echo "::group::$core ($exe)"
|
||||
gdb -batch -ex "thread apply all bt" "$exe" "$core" || true
|
||||
echo "::endgroup::"
|
||||
done
|
||||
@@ -4,9 +4,17 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
@@ -22,36 +30,76 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
build_name: [macos-sequoia-intel, macos-sequoia-apple-silicon, macos-tahoe-intel, macos-tahoe-apple-silicon]
|
||||
build_name: [macos-sequoia-apple-silicon, macos-tahoe-apple-silicon, macos-tahoe-apple-silicon-cv5]
|
||||
include:
|
||||
- build_name: macos-sequoia-intel
|
||||
os: macos-15-intel
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
|
||||
# macos-sequoia-intel temporarily disabled. Had some g2o optimizer issues.
|
||||
#- build_name: macos-sequoia-intel
|
||||
# os: macos-15-intel
|
||||
# cv: opencv@4
|
||||
- build_name: macos-sequoia-apple-silicon
|
||||
os: macos-15
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
|
||||
- build_name: macos-tahoe-intel
|
||||
os: macos-26-intel
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
|
||||
cv: opencv@4
|
||||
# - build_name: macos-tahoe-intel
|
||||
# os: macos-26-intel
|
||||
# cv: opencv@4
|
||||
- build_name: macos-tahoe-apple-silicon
|
||||
os: macos-26
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
|
||||
|
||||
cv: opencv@4
|
||||
# - build_name: macos-tahoe-intel-cv5
|
||||
# os: macos-26-intel
|
||||
# cv: opencv
|
||||
- build_name: macos-tahoe-apple-silicon-cv5
|
||||
os: macos-26
|
||||
cv: opencv
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restore test data
|
||||
id: cache-testdata
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# SQLite DBs are binary-portable -> share the cache across
|
||||
# linux / macos / windows. Key omits runner.os on purpose so all
|
||||
# three OSes hit the same entry.
|
||||
path: data/tests/*.db
|
||||
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
|
||||
|
||||
- name: Fetch test data
|
||||
if: steps.cache-testdata.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: bash scripts/fetch_test_data.sh
|
||||
|
||||
- name: Install Brew Dependencies
|
||||
run: |
|
||||
# Update brew and install from Brewfile if present, or specific packages
|
||||
brew install pcl opencv octomap g2o pdal
|
||||
brew install pcl octomap pdal yaml-cpp librealsense libfreenect libusb zlib libomp suite-sparse ceres-solver ${{ matrix.cv }}
|
||||
|
||||
- name: Install Source Dependencies
|
||||
# Build (and per-dependency cache) the source-only deps not available from
|
||||
# Homebrew, then install them into /usr/local. See the composite action.
|
||||
uses: ./.github/actions/install-macos-source-deps
|
||||
with:
|
||||
os: ${{ matrix.os }}
|
||||
build_type: ${{ env.BUILD_TYPE }}
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.extra_cmake_def }}
|
||||
# Apple clang has no built-in OpenMP; point find_package(OpenMP) at
|
||||
# Homebrew's keg-only libomp so PCL/g2o/rtabmap enable OpenMP instead of
|
||||
# repeatedly logging "Could NOT find OpenMP".
|
||||
LIBOMP=$(brew --prefix libomp)
|
||||
cmake -B ${{github.workspace}}/build \
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
|
||||
-DBUILD_TESTING=ON \
|
||||
-DBUILD_AS_BUNDLE=ON \
|
||||
-DWITH_ORBBEC_SDK=ON \
|
||||
-DWITH_DEPTHAI=ON \
|
||||
-DWITH_CERES=ON \
|
||||
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I$LIBOMP/include" \
|
||||
-DOpenMP_C_LIB_NAMES=omp \
|
||||
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I$LIBOMP/include" \
|
||||
-DOpenMP_CXX_LIB_NAMES=omp \
|
||||
-DOpenMP_omp_LIBRARY="$LIBOMP/lib/libomp.dylib"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
@@ -61,23 +109,59 @@ jobs:
|
||||
run: |
|
||||
./rtabmap-console --version
|
||||
|
||||
# - name: Build MacOS Package
|
||||
# run: |
|
||||
# cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target package
|
||||
- name: Build MacOS Package
|
||||
run: |
|
||||
cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target package
|
||||
|
||||
# - name: Upload RTABMap Artifacts (DMG)
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: RTABMap-Binaries-${{ matrix.build_name }}-zip
|
||||
# path: |
|
||||
# build/RTABMap-*.dmg
|
||||
# compression-level: 0
|
||||
# if-no-files-found: warn
|
||||
# retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
|
||||
- name: Upload RTABMap Artifacts (DMG)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RTABMap-Binaries-${{ matrix.build_name }}-nonsigned-zip
|
||||
path: |
|
||||
build/RTABMap-*.dmg
|
||||
compression-level: 0
|
||||
if-no-files-found: warn
|
||||
retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
# PYTHONNOUSERSITE=1: prevent the embedded Python interpreter from
|
||||
# loading numpy / other site-packages from the user's site that were
|
||||
# compiled against a different ABI than the build-time Python.
|
||||
env:
|
||||
PYTHONNOUSERSITE: 1
|
||||
run: |
|
||||
ctest -C ${{env.BUILD_TYPE}} -V -LE performance
|
||||
|
||||
# A ctest SEGFAULT is reported as just "SEGFAULT" with no backtrace, which
|
||||
# makes a crash inside a long integration test invisible -- the log simply
|
||||
# stops mid-test. macOS's ReportCrash writes a symbolized .ips report for
|
||||
# every crashed process, so surface any that appeared during this job.
|
||||
- name: Dump macOS crash reports on failure
|
||||
if: failure()
|
||||
run: |
|
||||
# ReportCrash can lag the process death by a few seconds.
|
||||
sleep 20
|
||||
found=0
|
||||
for d in "$HOME/Library/Logs/DiagnosticReports" /Library/Logs/DiagnosticReports; do
|
||||
[ -d "$d" ] || continue
|
||||
while IFS= read -r f; do
|
||||
found=1
|
||||
echo "::group::$f"
|
||||
cat "$f"
|
||||
echo "::endgroup::"
|
||||
done < <(find "$d" -type f \( -name '*.ips' -o -name '*.crash' \) -mtime -1 2>/dev/null | sort)
|
||||
done
|
||||
if [ "$found" = 0 ]; then
|
||||
echo "No crash reports found -- the job may have failed without a crash."
|
||||
fi
|
||||
|
||||
- name: Upload ctest log on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ctest-log-${{ matrix.build_name }}
|
||||
path: build/Testing/Temporary/LastTest.log
|
||||
if-no-files-found: warn
|
||||
retention-days: 7
|
||||
|
||||
# - name: Test
|
||||
# working-directory: ${{github.workspace}}/build
|
||||
# # Execute tests defined by the CMake configuration.
|
||||
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
# run: ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
|
||||
@@ -4,43 +4,111 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- kilted-devel
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# The CMake configure and build commands are platform agnostic and should work equally
|
||||
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||
# cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
name: ${{ matrix.ros_distribution }}
|
||||
name: ${{ matrix.ros_distribution }}${{ matrix.use_ros2_testing && '-testing' || '' }}
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.ros_distribution }}-${{ matrix.use_ros2_testing }}
|
||||
cancel-in-progress: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ros_distribution: [ kilted ]
|
||||
# Build against both main (what users install) and ros2-testing (closest to
|
||||
# what the buildfarm builds bloom releases against).
|
||||
use_ros2_testing: [ false, true ]
|
||||
include:
|
||||
- ros_distribution: 'kilted'
|
||||
skip_keys: ""
|
||||
skip_keys: "" # When releasing to ROS2, the skip_keys should be empty, patch these deps in package.xml instead.
|
||||
container:
|
||||
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-full
|
||||
steps:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restore test data
|
||||
id: cache-testdata
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: data/tests/*.db
|
||||
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
|
||||
|
||||
- name: Fetch test data
|
||||
if: steps.cache-testdata.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
# The ROS images are slim; fetch_test_data.sh needs curl, and 7-Zip for
|
||||
# the assets that come as an archive. The package holding it is
|
||||
# p7zip-full up to Ubuntu 24.04 and 7zip on the newer ones.
|
||||
command -v curl >/dev/null || (apt-get update && apt-get install -y --no-install-recommends curl)
|
||||
command -v 7z >/dev/null || command -v 7zz >/dev/null || (apt-get update && \
|
||||
(apt-get install -y --no-install-recommends p7zip-full || \
|
||||
apt-get install -y --no-install-recommends 7zip))
|
||||
bash scripts/fetch_test_data.sh
|
||||
|
||||
# `${{ github.workspace }}` is expanded by the runner on the *host*
|
||||
# (/home/runner/work/...), but this job runs in a container where the runner
|
||||
# bind-mounts that directory somewhere else (/__w/...). Baking the host path
|
||||
# into RTABMAP_TEST_DATA_ROOT points every data-driven test at a directory
|
||||
# that does not exist in the container: the integration tests silently skip
|
||||
# and the ones that imread() committed fixtures abort outright.
|
||||
#
|
||||
# Resolve the path inside the container instead. A `run` step's cwd is the
|
||||
# checkout root -- the same assumption the relative `scripts/...` and
|
||||
# `data/tests/*.db` paths in the steps above already rely on -- so derive it
|
||||
# from $PWD rather than trusting a path computed outside the container. The
|
||||
# existence checks then turn that into a verified precondition: a wrong
|
||||
# mount point or a failed fetch fails here, with the path printed, instead
|
||||
# of degrading into skipped tests.
|
||||
- name: Resolve test data root in the container
|
||||
id: testdata
|
||||
shell: bash
|
||||
run: |
|
||||
root="$PWD/data"
|
||||
test -f "$root/samples/17.jpg" || { echo "::error::test data root $root is missing committed fixtures"; exit 1; }
|
||||
ls "$root"/tests/*.db >/dev/null || { echo "::error::no test databases in $root/tests"; exit 1; }
|
||||
echo "root=$root" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# The osrf/ros image ships ros2-apt-source (main), which conflicts with the
|
||||
# ros2-testing-apt-source package setup-ros tries to install. Remove it so
|
||||
# setup-ros can switch the image to the testing repo.
|
||||
- name: Remove ROS main apt source
|
||||
if: matrix.use_ros2_testing
|
||||
run: dpkg --purge ros2-apt-source
|
||||
|
||||
- uses: ros-tooling/[email protected]
|
||||
with:
|
||||
required-ros-distributions: ${{ matrix.ros_distribution }}
|
||||
use-ros2-testing: ${{ matrix.use_ros2_testing }}
|
||||
|
||||
# setup-ros doesn't upgrade on noble/resolute, so the packages preinstalled
|
||||
# in the image would stay at their main versions. Upgrade them to testing.
|
||||
- name: Upgrade ROS packages to testing
|
||||
if: matrix.use_ros2_testing
|
||||
run: apt-get update && apt-get dist-upgrade -y
|
||||
- uses: ros-tooling/[email protected]
|
||||
with:
|
||||
package-name: rtabmap
|
||||
target-ros2-distro: ${{ matrix.ros_distribution }}
|
||||
rosdep-skip-keys: "${{ matrix.skip_keys }}"
|
||||
|
||||
coverage-result: false
|
||||
extra-cmake-args: -DTEST_DATA_ROOT=${{ steps.testdata.outputs.root }}
|
||||
|
||||
@@ -4,9 +4,17 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
@@ -27,15 +35,73 @@ jobs:
|
||||
- build_name: windows-2022
|
||||
os: windows-2022
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=OFF'
|
||||
extra_cmake_def: '-DWITH_TORCH=OFF -DWITH_ZED=OFF'
|
||||
- build_name: windows-2022-cuda
|
||||
os: windows-2022
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=ON'
|
||||
extra_cmake_def: '-DWITH_TORCH=ON -DWITH_ZED=ON -DWITH_CUDASIFT=ON'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restore test data
|
||||
id: cache-testdata
|
||||
if: matrix.build_name != 'windows-2022-cuda'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# SQLite DBs are binary-portable -> share the cache across
|
||||
# linux / macos / windows. Key omits runner.os on purpose so all
|
||||
# three OSes hit the same entry.
|
||||
path: data/tests/*.db
|
||||
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
|
||||
|
||||
- name: Fetch test data
|
||||
if: matrix.build_name != 'windows-2022-cuda' && steps.cache-testdata.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: bash scripts/fetch_test_data.sh
|
||||
|
||||
- name: Install VC++ 2012 runtime
|
||||
# The Kinect for Windows SDK 2.0 (WITH_K4W2=ON) is a VS2012 build, so
|
||||
# Kinect20.dll needs MSVCR110.dll and MSVCP110.dll, and it reaches
|
||||
# rtabmap_core as a load-time import. bundle_windows_deps.bat stages only
|
||||
# Kinect20.dll itself into the vcpkg export, not the runtime it was built
|
||||
# against, and the windows-2022 image lists no VC++ 2012 runtime (only
|
||||
# 2013 and 2022). When nothing else on the machine happens to supply them,
|
||||
# every executable linking rtabmap_core dies in the loader with 0xc0000135
|
||||
# (STATUS_DLL_NOT_FOUND) before reaching main(), while the utilite tests,
|
||||
# which link nothing but psapi, keep passing.
|
||||
#
|
||||
# The durable fix is to stage the two DLLs beside Kinect20.dll in the
|
||||
# bundle, which would cover the shipped package too; that needs the bundle
|
||||
# rebuilt and the cache key bumped, so install them here for now.
|
||||
#
|
||||
# Not pinned to one matrix leg: both build the package, and a package with
|
||||
# Kinect support carries the same requirement.
|
||||
shell: pwsh
|
||||
run: |
|
||||
$need = @('msvcr110.dll', 'msvcp110.dll')
|
||||
function Get-Missing {
|
||||
$need | Where-Object { -not (Test-Path (Join-Path "$env:SystemRoot\System32" $_)) }
|
||||
}
|
||||
|
||||
if (-not (Get-Missing)) {
|
||||
Write-Host "VC++ 2012 runtime already present in System32, nothing to do"
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-Host "Missing before install: $((Get-Missing) -join ', ')"
|
||||
choco install -y vcredist2012 --no-progress
|
||||
Write-Host "choco exit code: $LASTEXITCODE"
|
||||
|
||||
$still = Get-Missing
|
||||
if ($still) {
|
||||
# Warn rather than fail: the dependency dump in the next step reports
|
||||
# the whole picture, which is more useful than stopping here.
|
||||
Write-Host "::warning::Still missing from System32 after vcredist2012: $($still -join ', ')"
|
||||
} else {
|
||||
Write-Host "VC++ 2012 runtime installed: $($need -join ', ')"
|
||||
}
|
||||
|
||||
- name: Install Windows Dependencies
|
||||
if: matrix.build_name == 'windows-2022'
|
||||
uses: ./.github/actions/install-windows-deps
|
||||
@@ -46,10 +112,26 @@ jobs:
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
# K4A, K4W2 and ZED are located via these env vars (FindK4A.cmake / FindKinectSDK2.cmake
|
||||
# and the install rules), pointing at the export where the bundle staged their SDK files.
|
||||
$env:K4A_ROOT_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
$env:KINECTSDK20_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
$env:ZED_SDK_ROOT_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
cmake `
|
||||
-B ${{github.workspace}}/build `
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
|
||||
-DBUILD_AS_BUNDLE=ON `
|
||||
-DWITH_PYTHON=ON `
|
||||
-DWITH_CERES=ON `
|
||||
-DWITH_ORBBEC_SDK=ON `
|
||||
-DWITH_FREENECT2=ON `
|
||||
-DWITH_K4W2=ON `
|
||||
-DWITH_K4A=ON `
|
||||
-DWITH_DEPTHAI=ON `
|
||||
-DWITH_REALSENSE2=ON `
|
||||
-DWITH_CCCORELIB=ON `
|
||||
${{ matrix.extra_cmake_def }} `
|
||||
-DBUILD_TESTING=ON `
|
||||
-DVCPKG_MANIFEST_INSTALL=OFF `
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-release `
|
||||
-DVCPKG_INSTALLED_DIR="${{env.VCPKG_EXPORT_PATH}}/installed" `
|
||||
@@ -57,7 +139,149 @@ jobs:
|
||||
-DTorch_DIR=${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release/tools/python3/Lib/site-packages/torch/share/cmake/Torch
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ALL_BUILD
|
||||
|
||||
- name: Diagnose loader dependencies
|
||||
# ctest reports a loader failure as nothing but "Exit code 0xc0000135"
|
||||
# (STATUS_DLL_NOT_FOUND): the process dies before main(), so gtest prints
|
||||
# no output and the log never names the DLL that was not found. This walks
|
||||
# the import tree of the executables ctest is about to run and reports the
|
||||
# ones that do not resolve against the search path those processes see.
|
||||
#
|
||||
# Runs before Test, and keeps going on failure, so the report is in the log
|
||||
# whether or not ctest then fails. Diagnostic only: it asserts nothing.
|
||||
if: matrix.build_name != 'windows-2022-cuda'
|
||||
continue-on-error: true
|
||||
shell: pwsh
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: |
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if (-not (Test-Path $vswhere)) { Write-Host "vswhere not found, skipping"; exit 0 }
|
||||
$vsPath = & $vswhere -latest -property installationPath
|
||||
# Sorted descending so this is the newest toolset, the one that built
|
||||
# the binaries, rather than whichever side-by-side version sorts first.
|
||||
$dumpbin = Get-ChildItem "$vsPath\VC\Tools\MSVC" -Filter 'dumpbin.exe' -Recurse -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.FullName -like '*\Hostx64\x64\*' } |
|
||||
Sort-Object FullName -Descending | Select-Object -First 1
|
||||
if (-not $dumpbin) { Write-Host "dumpbin not found under $vsPath, skipping"; exit 0 }
|
||||
Write-Host "dumpbin : $($dumpbin.FullName)"
|
||||
Write-Host "bin dir : $((Get-Location).Path) ($((Get-ChildItem -Filter '*.dll').Count) DLLs)"
|
||||
|
||||
# The loader looks in the executable's own directory first, then
|
||||
# System32, then PATH. api-ms-win-* / ext-ms-* are virtual API sets
|
||||
# resolved by the loader with no file on disk, so they never count as
|
||||
# missing.
|
||||
$searchDirs = @((Get-Location).Path, "$env:SystemRoot\System32") +
|
||||
($env:PATH -split ';' | Where-Object { $_ -and (Test-Path $_) })
|
||||
|
||||
# Load-time and delay-load imports have to be told apart: only a
|
||||
# missing load-time import kills the process with 0xc0000135. A missing
|
||||
# delay-load one is resolved on first call, or never, so it is normal
|
||||
# for the Windows security stack (HvsiFileTrust, wpaxholder) to show up
|
||||
# there on a runner. dumpbin prints them in two sections.
|
||||
function Get-Imports($file) {
|
||||
$load = @(); $delay = @(); $mode = $null
|
||||
foreach ($line in (& $dumpbin.FullName /dependents $file 2>$null)) {
|
||||
if ($line -match 'following delay load dependencies') { $mode = 'delay'; continue }
|
||||
elseif ($line -match 'following dependencies') { $mode = 'load'; continue }
|
||||
elseif ($line -match '^\s*Summary') { $mode = $null; continue }
|
||||
if ($mode -and $line -match '^\s+(\S+\.dll)\s*$') {
|
||||
if ($mode -eq 'load') { $load += $Matches[1] } else { $delay += $Matches[1] }
|
||||
}
|
||||
}
|
||||
[pscustomobject]@{ Load = $load; Delay = $delay }
|
||||
}
|
||||
|
||||
function Test-Resolvable($dll) {
|
||||
$key = $dll.ToLower()
|
||||
if ($key -like 'api-ms-*' -or $key -like 'ext-ms-*') { return $true }
|
||||
[bool]($searchDirs | ForEach-Object { Join-Path $_ $dll } |
|
||||
Where-Object { Test-Path $_ } | Select-Object -First 1)
|
||||
}
|
||||
|
||||
function Resolve-Dll($dll) {
|
||||
$searchDirs | ForEach-Object { Join-Path $_ $dll } |
|
||||
Where-Object { Test-Path $_ } | Select-Object -First 1
|
||||
}
|
||||
|
||||
# Recurses through load-time imports only, which is the graph the
|
||||
# loader must satisfy before main() runs. Delay-load imports of each
|
||||
# visited binary are checked but not followed.
|
||||
function Walk($file, $seen, $missing, $missingDelay) {
|
||||
$imports = Get-Imports $file
|
||||
foreach ($dll in $imports.Delay) {
|
||||
if (-not (Test-Resolvable $dll)) { [void]$missingDelay.Add($dll) }
|
||||
}
|
||||
foreach ($dll in $imports.Load) {
|
||||
if (-not $seen.Add($dll.ToLower())) { continue }
|
||||
if ($dll.ToLower() -like 'api-ms-*' -or $dll.ToLower() -like 'ext-ms-*') { continue }
|
||||
$hit = Resolve-Dll $dll
|
||||
if ($hit) { Walk $hit $seen $missing $missingDelay }
|
||||
else { [void]$missing.Add("$dll <- imported by $(Split-Path $file -Leaf)") }
|
||||
}
|
||||
}
|
||||
|
||||
# test_ulogger passes today and rtabmap_core is what every failing test
|
||||
# has in common, so the three together separate "this executable is
|
||||
# broken" from "the dependency bundle is incomplete".
|
||||
foreach ($exe in @('test_ulogger.exe', 'test_corelib.exe', 'rtabmap-console.exe')) {
|
||||
if (-not (Test-Path $exe)) { Write-Host "--- $exe : not built"; continue }
|
||||
$seen = [System.Collections.Generic.HashSet[string]]::new()
|
||||
$missing = [System.Collections.Generic.HashSet[string]]::new()
|
||||
$missingDelay = [System.Collections.Generic.HashSet[string]]::new()
|
||||
Walk (Resolve-Path $exe).Path $seen $missing $missingDelay
|
||||
if ($missing.Count) {
|
||||
Write-Host "--- $exe : $($missing.Count) of $($seen.Count) LOAD-TIME imports MISSING (these fail the loader)"
|
||||
$missing | Sort-Object | ForEach-Object { Write-Host " $_" }
|
||||
} else {
|
||||
Write-Host "--- $exe : all $($seen.Count) load-time imports resolve"
|
||||
}
|
||||
if ($missingDelay.Count) {
|
||||
Write-Host " (delay-load, resolved on first call, not a loader failure: $(($missingDelay | Sort-Object) -join ', '))"
|
||||
}
|
||||
}
|
||||
- name: Test
|
||||
# Not run on the CUDA build, which is a build+package job only.
|
||||
#
|
||||
# The runner has no NVIDIA GPU or driver (see the driver-DLL note in
|
||||
# app/src/CMakeLists.txt), so no cv::cuda / CUDASIFT path can actually
|
||||
# execute there -- everything falls back to CPU and the run just repeats
|
||||
# the coverage the non-CUDA job already gives, on the same sources. It
|
||||
# used to cost more than it returned: the two cv::cuda-touching tests
|
||||
# (test_util3d_features, test_localgrid) had to be excluded because lazy
|
||||
# CUDA-init stalled them past the 300 s timeout, and once WITH_ZED=ON was
|
||||
# added to this job every remaining corelib test died in the loader with
|
||||
# 0xc0000135 (STATUS_DLL_NOT_FOUND) before reaching main(): rtabmap_core
|
||||
# links sl_zed64.dll, which imports the driver-only nvcuvid.dll /
|
||||
# nvEncodeAPI64.dll that a driver-less runner does not have.
|
||||
#
|
||||
# So this job compiles, links and packages the CUDA artifact; the
|
||||
# non-CUDA job is what verifies behaviour. Same reason the Info step
|
||||
# below is skipped here.
|
||||
if: matrix.build_name != 'windows-2022-cuda'
|
||||
working-directory: ${{github.workspace}}/build
|
||||
# PYTHONHOME points the embedded interpreter at vcpkg's bundled
|
||||
# Python install (where Lib/, DLLs/ live). Without it Python emits
|
||||
# "Could not find platform independent libraries <prefix>" at init
|
||||
# and runs without a stdlib, breaking every numpy import.
|
||||
# PYTHONNOUSERSITE=1: prevent the embedded Python interpreter from
|
||||
# loading numpy / other site-packages from %APPDATA%\Python that
|
||||
# were compiled against a different ABI than the build-time Python
|
||||
# (numpy 1.x/2.x mismatch crashes in test_pydetector /
|
||||
# test_pydescriptor / test_pymatcher).
|
||||
env:
|
||||
PYTHONHOME: ${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release/tools/python3
|
||||
PYTHONNOUSERSITE: 1
|
||||
run: |
|
||||
ctest -C ${{env.BUILD_TYPE}} -V --timeout 300 -LE performance
|
||||
|
||||
- name: Info
|
||||
# Skipped for CUDA: the binary links ZED (sl_zed64.dll -> nvcuvid/nvEncodeAPI64),
|
||||
# which need the NVIDIA driver; the GPU-less runner can't load the exe.
|
||||
if: matrix.build_name != 'windows-2022-cuda'
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: |
|
||||
./rtabmap-console --version
|
||||
|
||||
- name: Build Windows Package
|
||||
shell: pwsh
|
||||
@@ -73,11 +297,6 @@ jobs:
|
||||
shell: pwsh
|
||||
run: Get-ChildItem -Path "build" -Filter "RTABMap-*" | Rename-Item -NewName { $_.BaseName + "_cuda" + $_.Extension }
|
||||
|
||||
- name: Info
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: |
|
||||
./rtabmap-console --version
|
||||
|
||||
- name: Upload RTABMap Artifacts (ZIP)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -98,10 +317,3 @@ jobs:
|
||||
compression-level: 0
|
||||
if-no-files-found: warn
|
||||
retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
|
||||
|
||||
# - name: Test
|
||||
# working-directory: ${{github.workspace}}/build
|
||||
# # Execute tests defined by the CMake configuration.
|
||||
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||
# run: ctest -C ${{env.BUILD_TYPE}}
|
||||
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
name: Coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Debug
|
||||
|
||||
jobs:
|
||||
coverage:
|
||||
name: Coverage (ubuntu-24.04)
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restore test data
|
||||
id: cache-testdata
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# Same key as the other workflows so all of them share one entry.
|
||||
path: data/tests/*.db
|
||||
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
|
||||
|
||||
- name: Fetch test data
|
||||
if: steps.cache-testdata.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: bash scripts/fetch_test_data.sh
|
||||
|
||||
- name: Install Linux dependencies
|
||||
run: |
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
lcov \
|
||||
libopencv-dev \
|
||||
libpcl-dev \
|
||||
git \
|
||||
cmake \
|
||||
software-properties-common \
|
||||
libyaml-cpp-dev \
|
||||
libg2o-dev \
|
||||
libceres-dev \
|
||||
curl \
|
||||
gnupg \
|
||||
lsb-release
|
||||
|
||||
# GTSAM and libpointmatcher are not in the Ubuntu archive, and
|
||||
# borglab's gtsam PPAs have no noble packages (gtsam-release-4.2 has
|
||||
# no noble suite; gtsam-develop's noble Packages index is empty). The
|
||||
# ROS 2 repo ships both for noble, which is also what the ROS CI jobs
|
||||
# test against, so take them from there.
|
||||
sudo curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
|
||||
-o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
|
||||
| sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
ros-jazzy-gtsam \
|
||||
ros-jazzy-libpointmatcher
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake -B ${{ github.workspace }}/build \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
|
||||
-DENABLE_COVERAGE=ON \
|
||||
-DCMAKE_PREFIX_PATH=/opt/ros/jazzy \
|
||||
-DBUILD_TESTING=ON \
|
||||
-DBUILD_APP=OFF \
|
||||
-DBUILD_TOOLS=OFF \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DWITH_QT=OFF \
|
||||
-DWITH_PYTHON=OFF \
|
||||
-DWITH_CERES=ON \
|
||||
-DWITH_G2O=ON \
|
||||
-DWITH_GTSAM=ON \
|
||||
-DWITH_MRPT=OFF \
|
||||
-DWITH_CVSBA=OFF \
|
||||
-DWITH_POINTMATCHER=ON \
|
||||
-DWITH_CCCORELIB=OFF \
|
||||
-DWITH_OPEN3D=OFF \
|
||||
-DWITH_LOAM=OFF \
|
||||
-DWITH_FLOAM=OFF \
|
||||
-DWITH_LIOSAM=OFF \
|
||||
-DWITH_FLYCAPTURE2=OFF \
|
||||
-DWITH_ZED=OFF \
|
||||
-DWITH_ZEDOC=OFF \
|
||||
-DWITH_REALSENSE=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build ${{ github.workspace }}/build -j$(nproc)
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: |
|
||||
# The ROS packages are not on the default loader path. Both
|
||||
# directories are needed: GTSAM and libpointmatcher land in
|
||||
# /opt/ros/jazzy/lib, but gtsam's own libmetis-gtsam.so goes to the
|
||||
# multiarch subdirectory, and libgtsam.so carries no RUNPATH, so the
|
||||
# loader can only find it through LD_LIBRARY_PATH.
|
||||
ROS_LIB=/opt/ros/jazzy/lib
|
||||
export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:${ROS_LIB}:${ROS_LIB}/$(gcc -dumpmachine)${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
find ${{ github.workspace }}/build -name '*.gcda' -delete
|
||||
# Unit tests only ("long" is the end-to-end replay suite).
|
||||
#
|
||||
# Two reasons. It costs ~90 min in this instrumented -O0 build, 94% of
|
||||
# the job's test time, for ~3 points of coverage. And running it on
|
||||
# some events but not others makes the numbers incomparable: Codecov
|
||||
# measures a pull request against master, so a unit-only PR report
|
||||
# against a full master report reads as a coverage regression on every
|
||||
# PR. Same scope everywhere keeps the comparison meaningful.
|
||||
#
|
||||
# The replays still run (and gate) in the cmake-linux / macos /
|
||||
# windows jobs; they are just not measured here.
|
||||
ctest -V -LE "long|performance"
|
||||
|
||||
- name: Generate LCOV report
|
||||
run: |
|
||||
GCOV_VER="$(gcc -dumpversion | cut -d. -f1)"
|
||||
if command -v "gcov-${GCOV_VER}" >/dev/null 2>&1; then
|
||||
GCOV_TOOL="gcov-${GCOV_VER}"
|
||||
else
|
||||
GCOV_TOOL="gcov"
|
||||
fi
|
||||
LCOV_IGNORE=(--ignore-errors gcov,source,graph,mismatch,unused)
|
||||
|
||||
# The whole of corelib/utilite, test objects included, not just their src/.
|
||||
# An inline function defined in a header is emitted in whichever
|
||||
# translation unit wins comdat folding, which is often a test one, and
|
||||
# its counters then live in that unit's .gcda: capturing only src/
|
||||
# reports such a function as uncovered however often it is called. The
|
||||
# test sources themselves are dropped below, after the counters are read.
|
||||
lcov --gcov-tool "$GCOV_TOOL" "${LCOV_IGNORE[@]}" \
|
||||
--capture \
|
||||
--directory ${{ github.workspace }}/build/corelib \
|
||||
--directory ${{ github.workspace }}/build/utilite \
|
||||
--output-file lcov.info
|
||||
|
||||
lcov "${LCOV_IGNORE[@]}" --extract lcov.info \
|
||||
'${{ github.workspace }}/*' \
|
||||
--output-file lcov.info
|
||||
# The test sources are the instrument, not the subject: a line in a
|
||||
# test counts as uncovered only when the test skipped it (a defensive
|
||||
# cleanup branch, a platform guard), which says nothing about the
|
||||
# library. They are also near-fully covered by construction, so
|
||||
# leaving them in inflates the overall number. Excluded here, before
|
||||
# the upload, so the HTML artifact, the summary below and Codecov all
|
||||
# report the same figure. Kept in sync with coverage-report.sh.
|
||||
lcov "${LCOV_IGNORE[@]}" --remove lcov.info \
|
||||
'*/sqlite3/*' \
|
||||
'*/rtflann/*' \
|
||||
'*/corelib/test/*' \
|
||||
'*/utilite/test/*' \
|
||||
'*/_deps/*' \
|
||||
--output-file lcov.info
|
||||
|
||||
lcov --summary lcov.info
|
||||
|
||||
- name: HTML coverage report
|
||||
run: genhtml --ignore-errors source,mismatch lcov.info --output-directory coverage-html --legend --demangle-cpp
|
||||
|
||||
- name: Upload HTML coverage artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-html
|
||||
path: coverage-html
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload to Codecov
|
||||
if: ${{ env.CODECOV_TOKEN != '' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: lcov.info
|
||||
# Upload ONLY lcov.info. By default the CLI also searches the tree and
|
||||
# runs gcov over every .gcno it finds, uploading those .gcov files
|
||||
# alongside -- which re-introduced corelib/test and utilite/test on
|
||||
# Codecov even though the lcov --remove step had dropped them (the
|
||||
# HTML artifact, built from the same lcov.info, was correctly clean).
|
||||
disable_search: true
|
||||
plugins: noop
|
||||
token: ${{ env.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: false
|
||||
@@ -0,0 +1,227 @@
|
||||
name: docker-ros
|
||||
|
||||
# ROS images: focal/noetic (ROS1) and jammy/humble, noble/jazzy, noble-kilted,
|
||||
# resolute (ROS2). Android images live in android.yml.
|
||||
#
|
||||
# Every arch is built natively: amd64 on an x86 runner, arm64 on a GitHub
|
||||
# arm64 runner, so no QEMU emulation is involved. Because a single Docker Hub
|
||||
# tag cannot hold two independently pushed architectures, each build pushes an
|
||||
# arch-suffixed tag (e.g. :resolute-amd64 / :resolute-arm64) and a final job
|
||||
# joins them into the real multi-arch tag (:resolute) with `imagetools create`.
|
||||
#
|
||||
# The runner image only hosts the build; it does not have to match the Ubuntu
|
||||
# release inside the image, so ubuntu-26.04{,-arm} is used for all of them
|
||||
# (ubuntu-22.04{,-arm} and ubuntu-24.04{,-arm} also exist, if ever needed).
|
||||
# That is also why focal can sit in this matrix: a 20.04 userland runs fine on
|
||||
# a newer host kernel, and ros:noetic-perception publishes a native arm64 image.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths-ignore: &platform_only
|
||||
- '.github/workflows/android.yml'
|
||||
- '.github/workflows/ios.yml'
|
||||
- 'app/android/**'
|
||||
- 'app/ios/**'
|
||||
- 'docker/noble/android/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore: *platform_only
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
docker_deps:
|
||||
|
||||
# The ###-deps images used to be too flaky to build here at all (seg faults,
|
||||
# arm64 build timeouts under QEMU -- see
|
||||
# https://github.com/introlab/rtabmap/issues/1454) and had to be built by
|
||||
# hand from a 20.04 box with an upgraded qemu-user-static. Building each
|
||||
# arch natively removes that cause.
|
||||
# Skipped on pull requests; built and pushed only from master (push or
|
||||
# manual dispatch), since it pushes the :*-deps tags to Docker Hub.
|
||||
#
|
||||
# focal is deliberately absent: its ROS1/noetic deps are frozen, so
|
||||
# :focal-deps is built by hand on the rare occasion it changes. The focal
|
||||
# runtime image below still builds here, FROM the published :focal-deps.
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_dir: [jammy, noble, noble-kilted, resolute]
|
||||
arch: [amd64, arm64]
|
||||
include:
|
||||
- arch: amd64
|
||||
runner: ubuntu-26.04
|
||||
docker_platform: linux/amd64
|
||||
- arch: arm64
|
||||
runner: ubuntu-26.04-arm
|
||||
docker_platform: linux/arm64
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: ${{ matrix.docker_platform }}
|
||||
file: ./docker/${{ matrix.docker_dir }}/deps/Dockerfile
|
||||
tags: introlab3it/rtabmap:${{ matrix.docker_dir }}-deps-${{ matrix.arch }}
|
||||
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_dir }}-deps-${{ matrix.arch }}
|
||||
cache-to: type=inline
|
||||
|
||||
docker_deps_manifest:
|
||||
needs: docker_deps
|
||||
# Same gate as docker_deps, so both are skipped together on pull requests
|
||||
# (github.ref is refs/pull/<n>/merge there): the per-arch -deps tags this
|
||||
# joins are only ever pushed from master.
|
||||
if: ${{ !cancelled() && !failure() && github.ref == 'refs/heads/master' }}
|
||||
runs-on: ubuntu-26.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_dir: [jammy, noble, noble-kilted, resolute]
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Create multi-arch manifest
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t introlab3it/rtabmap:${{ matrix.docker_dir }}-deps \
|
||||
introlab3it/rtabmap:${{ matrix.docker_dir }}-deps-amd64 \
|
||||
introlab3it/rtabmap:${{ matrix.docker_dir }}-deps-arm64
|
||||
|
||||
docker:
|
||||
needs: docker_deps_manifest
|
||||
# Run even when the deps jobs are skipped (they are, on pull requests):
|
||||
# the runtime Dockerfiles then pull the :*-deps manifest already on Docker Hub.
|
||||
# A manual dispatch is honored only on master, the only ref we push from.
|
||||
if: ${{ !cancelled() && !failure() && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/master') }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_dir: [focal, jammy, noble, noble-kilted, resolute]
|
||||
arch: [amd64, arm64]
|
||||
include:
|
||||
- arch: amd64
|
||||
runner: ubuntu-26.04
|
||||
docker_platform: linux/amd64
|
||||
- arch: arm64
|
||||
runner: ubuntu-26.04-arm
|
||||
docker_platform: linux/arm64
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to DockerHub
|
||||
# Only needed when pushing; skipped on pull requests (secrets are
|
||||
# unavailable for fork PRs and we don't push there anyway).
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
platforms: ${{ matrix.docker_platform }}
|
||||
file: ./docker/${{ matrix.docker_dir }}/Dockerfile
|
||||
build-args: |
|
||||
RUN_TESTS=1
|
||||
tags: introlab3it/rtabmap:${{ matrix.docker_dir }}-${{ matrix.arch }}
|
||||
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_dir }}-${{ matrix.arch }}
|
||||
cache-to: type=inline
|
||||
|
||||
docker_manifest:
|
||||
needs: docker
|
||||
# Nothing to join on pull requests, where the per-arch tags are never pushed.
|
||||
if: ${{ !cancelled() && !failure() && github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/master') }}
|
||||
runs-on: ubuntu-26.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_dir: [focal, jammy, noble, noble-kilted, resolute]
|
||||
include:
|
||||
- docker_dir: focal
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:focal
|
||||
introlab3it/rtabmap:20.04
|
||||
- docker_dir: jammy
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:jammy
|
||||
introlab3it/rtabmap:22.04
|
||||
- docker_dir: noble
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble
|
||||
introlab3it/rtabmap:24.04
|
||||
- docker_dir: noble-kilted
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble-kilted
|
||||
# :latest tracks the newest ROS2 image (currently resolute, ROS2 lyrical
|
||||
# on ubuntu 26.04) -- move it along with the next distro bump.
|
||||
- docker_dir: resolute
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:resolute
|
||||
introlab3it/rtabmap:26.04
|
||||
introlab3it/rtabmap:latest
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Create multi-arch manifest
|
||||
env:
|
||||
DOCKER_TAGS: ${{ matrix.docker_tags }}
|
||||
run: |
|
||||
tag_args=()
|
||||
while read -r tag; do
|
||||
if [ -n "$tag" ]; then
|
||||
tag_args+=(-t "$tag")
|
||||
fi
|
||||
done <<< "$DOCKER_TAGS"
|
||||
docker buildx imagetools create "${tag_args[@]}" \
|
||||
introlab3it/rtabmap:${{ matrix.docker_dir }}-amd64 \
|
||||
introlab3it/rtabmap:${{ matrix.docker_dir }}-arm64
|
||||
@@ -1,240 +0,0 @@
|
||||
name: docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
docker_deps:
|
||||
|
||||
# Disabling ###-deps step from CI because it is too flaky (seg faults, arm64 build timeout...)
|
||||
# Only way I was able to build all images is to do it from a ubuntu 20.04 computer with:
|
||||
# $ sudo add-apt-repository ppa:canonical-server/server-backports
|
||||
# $ sudo apt-get update
|
||||
# $ sudo apt-get upgrade qemu-user-static
|
||||
# $ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
|
||||
# More info: https://github.com/introlab/rtabmap/issues/1454
|
||||
# Skipped on pull requests; built and pushed only on push to master.
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_tag: [focal-deps, jammy-deps, noble-deps, noble-kilted-deps, resolute-deps]
|
||||
include:
|
||||
- docker_tag: focal-deps
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:focal-deps
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'focal/deps'
|
||||
- docker_tag: jammy-deps
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:jammy-deps
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'jammy/deps'
|
||||
- docker_tag: noble-deps
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble-deps
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'noble/deps'
|
||||
- docker_tag: noble-kilted-deps
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble-kilted-deps
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'noble-kilted/deps'
|
||||
- docker_tag: resolute-deps
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:resolute-deps
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'resolute/deps'
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: ${{ matrix.docker_platforms }}
|
||||
file: ./docker/${{ matrix.docker_path }}/Dockerfile
|
||||
tags: ${{ matrix.docker_tags }}
|
||||
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_tag }}
|
||||
cache-to: type=inline
|
||||
|
||||
docker:
|
||||
needs: docker_deps
|
||||
# Run even when docker_deps is skipped (it is, on pull requests).
|
||||
if: ${{ !cancelled() && !failure() }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
docker_tag: [bionic, focal, jammy, noble, noble-kilted, resolute, android23, android24, android26, android30]
|
||||
include:
|
||||
- docker_tag: bionic
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:bionic
|
||||
introlab3it/rtabmap:18.04
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'bionic'
|
||||
- docker_tag: focal
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:focal
|
||||
introlab3it/rtabmap:20.04
|
||||
introlab3it/rtabmap:latest
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'focal'
|
||||
- docker_tag: jammy
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:jammy
|
||||
introlab3it/rtabmap:22.04
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'jammy'
|
||||
- docker_tag: noble
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble
|
||||
introlab3it/rtabmap:24.04
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'noble'
|
||||
- docker_tag: noble-kilted
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:noble-kilted
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'noble-kilted'
|
||||
- docker_tag: resolute
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:resolute
|
||||
introlab3it/rtabmap:26.04
|
||||
docker_args: |
|
||||
NOT_USED=0
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
docker_path: 'resolute'
|
||||
- docker_tag: android23
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android23
|
||||
introlab3it/rtabmap:tango
|
||||
docker_args: |
|
||||
API_VERSION=23
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
docker_path: 'noble/android/rtabmap_apiXX'
|
||||
- docker_tag: android24
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android24
|
||||
docker_args: |
|
||||
API_VERSION=24
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
docker_path: 'noble/android/rtabmap_apiXX'
|
||||
- docker_tag: android26
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android26
|
||||
docker_args: |
|
||||
API_VERSION=26
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
docker_path: 'noble/android/rtabmap_apiXX'
|
||||
- docker_tag: android30
|
||||
docker_tags: |
|
||||
introlab3it/rtabmap:android30
|
||||
docker_args: |
|
||||
API_VERSION=30
|
||||
docker_platforms: |
|
||||
linux/amd64
|
||||
docker_path: 'noble/android/rtabmap_apiXX'
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to DockerHub
|
||||
# Only needed when pushing; skipped on pull requests (secrets are
|
||||
# unavailable for fork PRs and we don't push there anyway).
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || matrix.docker_platforms }}
|
||||
file: ./docker/${{ matrix.docker_path }}/Dockerfile
|
||||
build-args: |
|
||||
${{ matrix.docker_args }}
|
||||
tags: ${{ matrix.docker_tags }}
|
||||
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_tag }}
|
||||
cache-to: type=inline
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
name: Documentation preview cleanup
|
||||
|
||||
# Removes the per-PR documentation preview published by docs.yml under
|
||||
# gh-pages:preview/pr-<number>/ once the pull request is closed (merged or not).
|
||||
#
|
||||
# Deliberately has no `paths` filter: docs.yml only publishes a preview when
|
||||
# documentation-related files changed, but this must fire for every close so a
|
||||
# preview can never be orphaned on the branch.
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
name: Remove PR preview
|
||||
# Forks never get a preview (their token is read-only), so nothing to clean.
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
# Same group as docs.yml's publish job: both push to gh-pages, and two
|
||||
# concurrent pushes would collide.
|
||||
concurrency:
|
||||
group: gh-pages-publish
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout gh-pages
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: gh-pages
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Remove preview directory
|
||||
env:
|
||||
PREVIEW_DIR: preview/pr-${{ github.event.number }}
|
||||
run: |
|
||||
set -eux
|
||||
if [[ ! -d "${PREVIEW_DIR}" ]]; then
|
||||
echo "No preview at ${PREVIEW_DIR}, nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
git config user.name 'github-actions[bot]'
|
||||
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git rm -r --quiet "${PREVIEW_DIR}"
|
||||
# Drop the parent too once the last preview is gone.
|
||||
rmdir preview 2>/dev/null || true
|
||||
git commit -m "Remove preview for PR #${{ github.event.number }}"
|
||||
git push
|
||||
@@ -0,0 +1,218 @@
|
||||
name: Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
# Publishing commits to the gh-pages branch, so only run when something that
|
||||
# affects the documentation actually changed. Use the manual "Run workflow"
|
||||
# button if a deploy is needed outside of these paths.
|
||||
paths: &docs_paths
|
||||
- '.github/workflows/docs.yml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'Doxyfile.in'
|
||||
- 'docs-report.sh'
|
||||
- 'website/**'
|
||||
- 'doxygen/**'
|
||||
- 'package.xml'
|
||||
- 'corelib/include/**'
|
||||
- 'utilite/include/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
paths: *docs_paths
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build site (ubuntu-24.04)
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
outputs:
|
||||
version: ${{ steps.site.outputs.version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
doxygen \
|
||||
graphviz \
|
||||
cmake \
|
||||
libopencv-dev \
|
||||
libpcl-dev \
|
||||
libyaml-cpp-dev \
|
||||
git
|
||||
|
||||
# Configures build-docs (CMake generates the export headers that are part
|
||||
# of Doxygen's INPUT), runs Doxygen into build-docs/api/latest/. Same
|
||||
# script used locally, so a local preview matches what gets published.
|
||||
- name: Generate C++ API documentation (Doxygen)
|
||||
run: ./docs-report.sh
|
||||
|
||||
# The theme emits absolute asset links built from site.baseurl, which
|
||||
# GitHub's own Jekyll infers from the repository (/rtabmap). A PR preview
|
||||
# is served from a deeper path, so those links would 404 there. Pin
|
||||
# baseurl to the path this particular build gets published to.
|
||||
- name: Set Jekyll baseurl
|
||||
run: |
|
||||
set -eux
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
baseurl="/${{ github.event.repository.name }}/preview/pr-${{ github.event.number }}"
|
||||
else
|
||||
baseurl="/${{ github.event.repository.name }}"
|
||||
fi
|
||||
echo "baseurl: ${baseurl}" >> website/_config.yml
|
||||
|
||||
# Landing page: built here rather than by GitHub's own Jekyll, so that
|
||||
# .nojekyll can be set below and the Doxygen output is served untouched.
|
||||
- name: Build landing page (Jekyll)
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./website
|
||||
destination: ./_site
|
||||
|
||||
- name: Assemble site
|
||||
id: site
|
||||
run: |
|
||||
set -eux
|
||||
# jekyll-build-pages is a container action running as root, so _site
|
||||
# comes back owned by root and the steps below (running as the runner
|
||||
# user) cannot write into it.
|
||||
sudo chown -R "$(id -u):$(id -g)" _site
|
||||
|
||||
# Serve everything verbatim: the site is already built, and Jekyll
|
||||
# would otherwise skip Doxygen files/folders starting with '_'.
|
||||
touch _site/.nojekyll
|
||||
|
||||
mkdir -p _site/api
|
||||
cp -r build-docs/api/latest _site/api/latest
|
||||
|
||||
# On a release tag (plain X.Y.Z, not the ROS-distro variants such as
|
||||
# 0.23.7-jazzy), also publish under the version number. Older versions
|
||||
# already on the branch are preserved by keep_files when publishing.
|
||||
version=""
|
||||
if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
version="${GITHUB_REF_NAME}"
|
||||
cp -r build-docs/api/latest "_site/api/${version}"
|
||||
fi
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# The dropdown list is maintained by hand in the repository (one entry
|
||||
# per release) and shared by every published version -- see the header
|
||||
# comment in doxygen/versions.js.
|
||||
cp doxygen/versions.js _site/api/versions.js
|
||||
|
||||
# /api/ has no content of its own: send it to the current docs so a
|
||||
# bare .../api/ link lands somewhere useful instead of a 404. The
|
||||
# target is relative, so it works at the site root and under a
|
||||
# preview prefix alike.
|
||||
printf '%s\n' \
|
||||
'<!doctype html>' \
|
||||
'<meta charset="utf-8">' \
|
||||
'<title>RTAB-Map API documentation</title>' \
|
||||
'<meta http-equiv="refresh" content="0; url=latest/">' \
|
||||
'<link rel="canonical" href="latest/">' \
|
||||
'<p>Redirecting to the <a href="latest/">latest API documentation</a>.</p>' \
|
||||
> _site/api/index.html
|
||||
|
||||
test -f _site/index.html
|
||||
test -f _site/api/index.html
|
||||
test -f _site/api/latest/index.html
|
||||
|
||||
- name: Upload site artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: documentation-site
|
||||
path: _site
|
||||
# include-hidden-files keeps .nojekyll, which the publish job needs.
|
||||
include-hidden-files: true
|
||||
retention-days: 14
|
||||
|
||||
publish:
|
||||
name: Publish to gh-pages
|
||||
needs: build
|
||||
# Forks are skipped for pull requests: their GITHUB_TOKEN is read-only, and
|
||||
# granting write access to a workflow that builds untrusted code would be a
|
||||
# security hole.
|
||||
if: >-
|
||||
github.event_name != 'pull_request' ||
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
# Serialize every push to gh-pages, including the preview cleanup workflow,
|
||||
# and never cancel one in flight: two concurrent pushes would collide.
|
||||
concurrency:
|
||||
group: gh-pages-publish
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download site
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: documentation-site
|
||||
path: _site
|
||||
|
||||
# Pull requests go to preview/pr-<number>/, everything else to the site
|
||||
# root. keep_files preserves what this run does not carry: the published
|
||||
# version folders (api/0.23.x/) and the other PRs' previews.
|
||||
- name: Publish
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages
|
||||
publish_dir: ./_site
|
||||
destination_dir: ${{ github.event_name == 'pull_request' && format('preview/pr-{0}', github.event.number) || '' }}
|
||||
keep_files: true
|
||||
# Do not let the action drop a .nojekyll at the *branch root*: that
|
||||
# disables Jekyll for everything on the branch, including content
|
||||
# published outside this deployment. The site we publish carries its
|
||||
# own .nojekyll inside destination_dir, which is the only place it
|
||||
# should apply.
|
||||
enable_jekyll: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
commit_message: >-
|
||||
${{ github.event_name == 'pull_request'
|
||||
&& format('Preview for PR #{0}', github.event.number)
|
||||
|| format('Update documentation ({0})', needs.build.outputs.version || 'latest') }}
|
||||
|
||||
- name: Link the site
|
||||
run: |
|
||||
base="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
url="${base}/preview/pr-${{ github.event.number }}"
|
||||
note="Removed automatically when this pull request is closed."
|
||||
else
|
||||
url="${base}"
|
||||
note=""
|
||||
fi
|
||||
{
|
||||
echo "### Documentation"
|
||||
echo ""
|
||||
echo "- Landing page: ${url}/"
|
||||
echo "- C++ API: ${url}/api/latest/"
|
||||
# An `if` rather than `[[ ... ]] && { ... }`: as the last command in
|
||||
# the group, a false test would make the group (and so the whole
|
||||
# step) exit 1. `note` is empty on push, which failed every master
|
||||
# run while pull requests passed.
|
||||
if [[ -n "${note}" ]]; then
|
||||
echo ""
|
||||
echo "${note}"
|
||||
fi
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -16,6 +16,7 @@ on:
|
||||
branches:
|
||||
- '**'
|
||||
paths: *ios_paths
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
|
||||
Reference in New Issue
Block a user