Skip to content

test: switch to catch2 unit tests and add some functions #38

test: switch to catch2 unit tests and add some functions

test: switch to catch2 unit tests and add some functions #38

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
BUILD_DIR: ${{ github.workspace }}/build
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler: [gcc, clang]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Create build directory
run: mkdir -p ${{ env.BUILD_DIR }}
- name: Install Clang
if: matrix.compiler == 'clang'
run: |
sudo apt-get install -y clang
sudo update-alternatives --remove-all cc
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 15
- name: Configure CMake
run: cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DHASHMAP_BUILD_TESTS=ON -DHASHMAP_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build_type }}
- name: Install
run: sudo cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build_type }}
- name: Test
run: ctest --output-on-failure --test-dir ${{ env.BUILD_DIR }}