Adding doc and tests #222
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake-Linux | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - '**' | |
| env: | |
| BUILD_TYPE: Release | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| 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] | |
| include: | |
| - build_name: ubuntu-22.04 | |
| os: ubuntu-22.04 | |
| extra_deps: "libunwind-dev libceres-dev" | |
| extra_cmake_def: "-DWITH_CERES=ON -DWITH_PYTHON=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" | |
| - 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" | |
| 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 }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install numpy pybind11 | |
| - 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 }} | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| - name: Info | |
| working-directory: ${{github.workspace}}/build/bin | |
| run: | | |
| ./rtabmap-console --version | |
| - 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: | | |
| ctest -C ${{env.BUILD_TYPE}} --output-on-failure | |
| ctest -C ${{env.BUILD_TYPE}} --output-on-failure --rerun-failed |