Skip to content

[pre-commit.ci] pre-commit autoupdate #580

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #580

Workflow file for this run

name: Run Tests
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
# https://stackoverflow.com/questions/66335225
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CMAKE_GENERATOR: Ninja
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
steps:
- name: Checkout Copclib
uses: actions/checkout@v4
- name: Free up disk space
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm -rf /usr/share/dotnet
- uses: actions/checkout@v4
name: Checkout laz-perf
with:
repository: hobu/laz-perf
ref: 3.4.0
path: libs/laz-perf
- uses: ilammy/msvc-dev-cmd@v1
- name: Build Catch2
run: |
git clone https://github.com/catchorg/Catch2.git libs/Catch2 --depth 1 --branch v2.13.10
cmake -B build_catch2 -S libs/Catch2 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
cmake --build build_catch2 --config ${{env.BUILD_TYPE}} --target install
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -G Ninja -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_TESTS=ON -DWITH_PYTHON=OFF -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
- name: Build
# Build your program with the given configuration
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}}
- 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}} --output-on-failure --no-tests=error