Cista rtree Implementation (#230) #664
This file contains 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: Linux Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: | |
- published | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install clang-format | |
uses: ./.github/actions/install-llvm | |
with: | |
packages: clang-format-17 | |
- name: Format files | |
run: find include test -type f -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-17 -i | |
- name: Check for differences | |
run: | | |
git status --porcelain | |
git status --porcelain | xargs -I {} -0 test -z \"{}\" | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: | |
- name: GCC 12 Release | |
cxx: g++-12 | |
cc: gcc-12 | |
mode: Release | |
- name: GCC 12 Debug | |
cxx: g++-12 | |
cc: gcc-12 | |
mode: Debug | |
valgrind: true | |
- name: Clang 17 Release | |
cxx: clang++-17 | |
cc: clang-17 | |
mode: Release | |
cxxflags: -stdlib=libc++ | |
ldflags: -lc++abi | |
- name: Clang 17 Debug | |
cxx: clang++-17 | |
cc: clang-17 | |
mode: Debug | |
fuzz: true | |
- key: Clang 17 Sanitizer | |
cxx: clang++-17 | |
cc: clang-17 | |
mode: Debug | |
cflags: -fsanitize=address,undefined -fno-omit-frame-pointer | |
cxxflags: -fsanitize=address,undefined -fno-omit-frame-pointer | |
env: | |
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ninja | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: sudo apt-get install -y --no-install-recommends ninja-build | |
# ==== INSTALL ==== | |
- name: Install Clang | |
uses: ./.github/actions/install-llvm | |
with: | |
packages: libstdc++-12-dev libc++-17-dev libc++abi-17-dev clang-tidy-17 libunwind-17-dev llvm-17 libfuzzer-17-dev llvm-17-dev libclang-rt-17-dev | |
# ==== BUILD ==== | |
- name: CMake | |
run: | | |
cmake \ | |
-G Ninja -S . -B build \ | |
-DCISTA_FMT=OFF \ | |
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ | |
-DCMAKE_C_FLAGS="${{ matrix.config.cflags }}" \ | |
-DCMAKE_CXX_FLAGS="${{ matrix.config.cxxflags }}" \ | |
-DCMAKE_CXX_LINKER_FLAGS=${{ matrix.config.ldflags }}" \ | |
-DCMAKE_CXX_EXE_LINKER_FLAGS="${{ matrix.config.ldflags }} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.config.mode }} \ | |
-DCISTA_ZERO_OUT=${{ matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-12' }} | |
- name: Build | |
run: cmake --build build --target cista-test cista-test-single-header | |
# ==== TESTS ==== | |
- name: Run Tests | |
run: ./build/cista-test | |
- name: Run Single Header Tests | |
run: ./build/cista-test-single-header | |
# ==== VALGRIND ==== | |
- name: Install Valgrind | |
if: matrix.config.valgrind | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends valgrind | |
- name: Run Single Header Tests Valgrind | |
if: matrix.config.valgrind | |
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/cista-test | |
- name: Run Single Header Tests Tests Valgrind | |
if: matrix.config.valgrind | |
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/cista-test-single-header | |
# ==== FUZZ ==== | |
- name: Fuzzing | |
if: matrix.config.fuzz | |
run: | | |
cmake --build build --target \ | |
cista-fuzz-bitset_verification \ | |
cista-fuzz-bitvec_verification \ | |
cista-fuzz-graph \ | |
cista-fuzz-hash_map_verification \ | |
cista-fuzz-hash_set \ | |
cista-fuzz-multimap_verification | |
./build/cista-fuzz-hash_set -max_total_time=120 | |
./build/cista-fuzz-hash_map_verification -max_total_time=120 | |
./build/cista-fuzz-bitset_verification -max_total_time=120 | |
./build/cista-fuzz-bitvec_verification -max_total_time=120 | |
./build/cista-fuzz-graph -max_total_time=120 | |
./build/cista-fuzz-multimap_verification -max_total_time=120 | |
# ==== DISTRIBUTION ==== | |
- name: Upload Distribution | |
if: matrix.config.mode == 'Release' && matrix.config.cc == 'gcc-12' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cista.h | |
path: build/cista.h | |
# ==== RELEASE ==== | |
- name: Upload Release | |
if: github.event.action == 'published' && matrix.config.mode == 'Release' && matrix.config.cc == 'gcc-12' | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./build/cista.h | |
asset_name: cista.h | |
asset_content_type: text/plain |