Skip to content

Optimizations of L1 & L2 distance functors and miscellaneous improvements #128

Optimizations of L1 & L2 distance functors and miscellaneous improvements

Optimizations of L1 & L2 distance functors and miscellaneous improvements #128

Workflow file for this run

# Based on GTSAM file (by @ProfFan)
name: CI Linux
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.name }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 1
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
VERBOSE: 1 # to show all cmake scripts debug info
strategy:
fail-fast: false
matrix:
# Github Actions requires a single row to be added to the build matrix.
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
name:
[
ubuntu-22.04-gcc,
ubuntu-22.04-clang,
ubuntu-24.04-gcc,
ubuntu-24.04-clang,
]
build_type: [Release]
include:
- name: ubuntu-22.04-gcc
os: ubuntu-22.04
compiler: gcc
- name: ubuntu-22.04-clang
os: ubuntu-22.04
compiler: clang
- name: ubuntu-24.04-clang
os: ubuntu-24.04
compiler: clang
- name: ubuntu-24.04-gcc
os: ubuntu-24.04
compiler: gcc
- name: ubuntu-24.04-coverage
os: ubuntu-24.04
compiler: gcc
build_type: Coverage
steps:
- name: Checkout
uses: actions/checkout@master
- name: Git submodule
run: |
git submodule sync
git submodule update --init --recursive
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt install -y \
cmake build-essential cmake
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y g++ g++
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
else
sudo apt-get install -y clang g++-multilib
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
- name: CMake configure
run: |
cmake -DCMAKE_VERBOSE_MAKEFILE=ON \
-H. -Bbuild
- name: Build
run: |
make -C build
- name: Run tests
run: |
ctest --verbose --test-dir build
- name: Install lcov
if: matrix.build_type == 'Coverage'
run: sudo apt-get -y install lcov
- name: Generate coverage report
if: matrix.build_type == 'Coverage'
run: |
# 1. Capture coverage data from the build directory
# lcov finds all the .gcno and .gcda files
lcov --capture --directory build/ --output-file coverage.info --ignore-errors mismatch
# 2. Filter to *only* include the main header file
# This fulfills your request to not include examples/tests
lcov --extract coverage.info "*/include/nanoflann.hpp" --output-file coverage_filtered.info
# 3. Print a summary to the console log for easy debugging
echo "--- Coverage Summary for nanoflann.hpp ---"
lcov --list coverage_filtered.info
echo "------------------------------------------"
- name: Upload coverage to Codecov
if: matrix.build_type == 'Coverage'
uses: codecov/codecov-action@v4
with:
# The token is required for private repos, but recommended for all
token: ${{ secrets.CODECOV_TOKEN }}
# Path to the filtered report
files: ./coverage_filtered.info
# Optional name for this upload in the Codecov UI
name: codecov-ubuntu-24.04