Skip to content

chore: add CI workflow with cmake presets #2

chore: add CI workflow with cmake presets

chore: add CI workflow with cmake presets #2

Workflow file for this run

name: ci
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows (MSVC x64)
os: windows-latest
preset: msvc-x64
vcpkg_triplet: x64-windows
- name: Windows (Clang x64)
os: windows-latest
preset: llvm-x64
vcpkg_triplet: x64-windows
- name: Windows ARM64 (MSVC)
os: windows-11-arm
preset: msvc-arm64
vcpkg_triplet: arm64-windows
- name: Linux (GCC x64)
os: ubuntu-latest
preset: gcc-linux-x64
vcpkg_triplet: x64-linux-dynamic
- name: Linux (Clang x64)
os: ubuntu-latest
preset: clang-linux-x64
vcpkg_triplet: x64-linux-dynamic
- name: Linux ARM64 (GCC)
os: ubuntu-24.04-arm
preset: gcc-linux-arm64
vcpkg_triplet: arm64-linux
- name: macOS ARM64 (Clang)
os: macos-latest
preset: apple-clang-macos-arm64
vcpkg_triplet: arm64-osx
steps:
- uses: actions/checkout@v4
- name: Set VCPKG_ROOT
shell: bash
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
- name: Install Clang 18
if: matrix.preset == 'clang-linux-x64'
run: |
sudo apt-get install -y clang-18
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
- name: Install GTest
run: vcpkg install gtest:${{ matrix.vcpkg_triplet }}
- name: Configure
working-directory: tests/unittest
run: cmake --preset ${{ matrix.preset }}
- name: Build
working-directory: tests/unittest
run: cmake --build --preset ${{ matrix.preset }} --config Release
- name: Test
working-directory: tests/unittest/build/${{ matrix.preset }}
run: ctest --build-config Release --output-on-failure