mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
Configures CMake to utilize vcpkg for dependency management on both Linux and Windows platforms. This ensures consistent build environments across different operating systems and simplifies the integration of external libraries.
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: Omath CI (Arch Linux / Windows)
|
||
|
||
on:
|
||
push:
|
||
branches: [ main ]
|
||
pull_request:
|
||
branches: [ main ]
|
||
|
||
concurrency:
|
||
group: ci-${{ github.ref }}
|
||
cancel-in-progress: true
|
||
|
||
|
||
##############################################################################
|
||
# 1) ARCH LINUX – Clang / Ninja
|
||
##############################################################################
|
||
jobs:
|
||
arch-build-and-test:
|
||
name: Arch Linux (Clang)
|
||
runs-on: ubuntu-latest
|
||
container: archlinux:latest
|
||
env:
|
||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
|
||
steps:
|
||
- name: Install basic tool-chain with pacman
|
||
shell: bash
|
||
run: |
|
||
pacman -Sy --noconfirm archlinux-keyring
|
||
pacman -Syu --noconfirm --needed \
|
||
git base-devel clang cmake ninja
|
||
|
||
- name: Checkout repository (with sub-modules)
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Set up vcpkg
|
||
shell: bash
|
||
run: |
|
||
git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT"
|
||
- name: Configure (cmake --preset)
|
||
shell: bash
|
||
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON
|
||
|
||
- name: Build
|
||
shell: bash
|
||
run: cmake --build cmake-build/build/linux-release --target unit_tests omath
|
||
|
||
- name: Run unit_tests
|
||
shell: bash
|
||
run: ./out/Release/unit_tests
|
||
|
||
|
||
|
||
##############################################################################
|
||
# 2) Windows – MSVC / Ninja
|
||
##############################################################################
|
||
windows-build-and-test:
|
||
name: Windows (MSVC)
|
||
runs-on: windows-latest
|
||
env:
|
||
OMATH_BUILD_VIA_VCPKG: ON
|
||
|
||
steps:
|
||
- name: Checkout repository (with sub-modules)
|
||
uses: actions/checkout@v4
|
||
with:
|
||
submodules: recursive
|
||
|
||
- name: Install Ninja
|
||
uses: seanmiddleditch/gha-setup-ninja@v4
|
||
|
||
- name: Set up MSVC developer command-prompt
|
||
uses: ilammy/msvc-dev-cmd@v1
|
||
|
||
- name: Configure (cmake --preset)
|
||
shell: bash
|
||
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON
|
||
|
||
- name: Build
|
||
shell: bash
|
||
run: cmake --build cmake-build/build/windows-release --target unit_tests omath
|
||
|
||
- name: Run unit_tests.exe
|
||
shell: bash
|
||
run: ./out/Release/unit_tests.exe
|