mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Update cmake-multi-platform.yml
switched to clang Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml Update cmake-multi-platform.yml added runtime dir fix
This commit is contained in:
80
.github/workflows/cmake-multi-platform.yml
vendored
80
.github/workflows/cmake-multi-platform.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Omath CI (presets)
|
name: Omath CI (Arch Linux / Windows)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,48 +10,70 @@ concurrency:
|
|||||||
group: ci-${{ github.ref }}
|
group: ci-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-test:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
# ------- preset ↔ runner pairs -------------
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest # GCC / Ninja (from linux-release preset)
|
|
||||||
preset: linux-release
|
|
||||||
- os: macos-latest # Clang / Ninja (from darwin-release preset)
|
|
||||||
preset: darwin-release
|
|
||||||
- os: windows-latest # MSVC / Ninja (from windows-release preset)
|
|
||||||
preset: windows-release
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
##############################################################################
|
||||||
|
# 1) ARCH LINUX – Clang / Ninja
|
||||||
|
##############################################################################
|
||||||
|
jobs:
|
||||||
|
arch-build-and-test:
|
||||||
|
name: Arch Linux (Clang)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: archlinux:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 1) checkout (incl. GoogleTest sub-module)
|
- name: Install basic tool-chain with pacman
|
||||||
- name: Checkout repository
|
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: Configure (cmake --preset)
|
||||||
|
shell: bash
|
||||||
|
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
shell: bash
|
||||||
|
run: cmake --build cmake-build/build/linux-release --target all
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository (with sub-modules)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
# 2) Ninja (needed only on Windows images)
|
|
||||||
- name: Install Ninja
|
- name: Install Ninja
|
||||||
uses: seanmiddleditch/gha-setup-ninja@v4
|
uses: seanmiddleditch/gha-setup-ninja@v4
|
||||||
|
|
||||||
# 3) MSVC environment
|
|
||||||
- name: Set up MSVC developer command-prompt
|
- name: Set up MSVC developer command-prompt
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
# 4) Configure with the selected CMake preset
|
|
||||||
- name: Configure (cmake --preset)
|
- name: Configure (cmake --preset)
|
||||||
run: cmake --preset ${{ matrix.preset }} -DOMATH_BUILD_TESTS=ON
|
shell: bash
|
||||||
|
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON
|
||||||
|
|
||||||
# 5) Build
|
|
||||||
- name: Build
|
- name: Build
|
||||||
# All configure presets put the binary dir in cmake-build/build/${presetName}
|
shell: bash
|
||||||
run: cmake --build cmake-build/build/${{ matrix.preset }}
|
run: cmake --build cmake-build/build/windows-release --target all
|
||||||
|
|
||||||
# 6) Run unit-tests
|
- name: Run unit_tests.exe
|
||||||
- name: Test
|
shell: bash
|
||||||
working-directory: cmake-build/build/${{ matrix.preset }}
|
run: ./out/Release/unit_tests.exe
|
||||||
run: ctest --output-on-failure
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "gcc",
|
"CMAKE_C_COMPILER": "clang",
|
||||||
"CMAKE_CXX_COMPILER": "g++"
|
"CMAKE_CXX_COMPILER": "clang++"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ add_executable(unit_tests ${UNIT_TESTS_SOURCES})
|
|||||||
set_target_properties(unit_tests PROPERTIES
|
set_target_properties(unit_tests PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||||
UNITY_BUILD ON
|
UNITY_BUILD ON
|
||||||
UNITY_BUILD_BATCH_SIZE 20
|
UNITY_BUILD_BATCH_SIZE 20
|
||||||
CXX_STANDARD 23
|
CXX_STANDARD 23
|
||||||
|
|||||||
Reference in New Issue
Block a user