Skip to content

Commit 30eef59

Browse files
committed
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
1 parent c2a6cf5 commit 30eef59

File tree

3 files changed

+54
-31
lines changed

3 files changed

+54
-31
lines changed
+51-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Omath CI (presets)
1+
name: Omath CI (Arch Linux / Windows)
22

33
on:
44
push:
@@ -10,48 +10,70 @@ concurrency:
1010
group: ci-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
14+
##############################################################################
15+
# 1) ARCH LINUX – Clang / Ninja
16+
##############################################################################
1317
jobs:
14-
build-and-test:
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
# ------- preset ↔ runner pairs -------------
19-
include:
20-
- os: ubuntu-latest # GCC / Ninja (from linux-release preset)
21-
preset: linux-release
22-
- os: macos-latest # Clang / Ninja (from darwin-release preset)
23-
preset: darwin-release
24-
- os: windows-latest # MSVC / Ninja (from windows-release preset)
25-
preset: windows-release
26-
27-
runs-on: ${{ matrix.os }}
18+
arch-build-and-test:
19+
name: Arch Linux (Clang)
20+
runs-on: ubuntu-latest
21+
container: archlinux:latest
22+
23+
steps:
24+
- name: Install basic tool-chain with pacman
25+
shell: bash
26+
run: |
27+
pacman -Sy --noconfirm archlinux-keyring
28+
pacman -Syu --noconfirm --needed \
29+
git base-devel clang cmake ninja
30+
31+
- name: Checkout repository (with sub-modules)
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: recursive
35+
36+
- name: Configure (cmake --preset)
37+
shell: bash
38+
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON
39+
40+
- name: Build
41+
shell: bash
42+
run: cmake --build cmake-build/build/linux-release --target all
43+
44+
- name: Run unit_tests
45+
shell: bash
46+
run: ./out/Release/unit_tests
47+
48+
49+
50+
##############################################################################
51+
# 2) Windows – MSVC / Ninja
52+
##############################################################################
53+
windows-build-and-test:
54+
name: Windows (MSVC)
55+
runs-on: windows-latest
2856

2957
steps:
30-
# 1) checkout (incl. GoogleTest sub-module)
31-
- name: Checkout repository
58+
- name: Checkout repository (with sub-modules)
3259
uses: actions/checkout@v4
3360
with:
3461
submodules: recursive
3562

36-
# 2) Ninja (needed only on Windows images)
3763
- name: Install Ninja
3864
uses: seanmiddleditch/gha-setup-ninja@v4
3965

40-
# 3) MSVC environment
4166
- name: Set up MSVC developer command-prompt
42-
if: runner.os == 'Windows'
4367
uses: ilammy/msvc-dev-cmd@v1
4468

45-
# 4) Configure with the selected CMake preset
4669
- name: Configure (cmake --preset)
47-
run: cmake --preset ${{ matrix.preset }} -DOMATH_BUILD_TESTS=ON
70+
shell: bash
71+
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON
4872

49-
# 5) Build
5073
- name: Build
51-
# All configure presets put the binary dir in cmake-build/build/${presetName}
52-
run: cmake --build cmake-build/build/${{ matrix.preset }}
74+
shell: bash
75+
run: cmake --build cmake-build/build/windows-release --target all
5376

54-
# 6) Run unit-tests
55-
- name: Test
56-
working-directory: cmake-build/build/${{ matrix.preset }}
57-
run: ctest --output-on-failure
77+
- name: Run unit_tests.exe
78+
shell: bash
79+
run: ./out/Release/unit_tests.exe

CMakePresets.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
4141
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
4242
"cacheVariables": {
43-
"CMAKE_C_COMPILER": "gcc",
44-
"CMAKE_CXX_COMPILER": "g++"
43+
"CMAKE_C_COMPILER": "clang",
44+
"CMAKE_CXX_COMPILER": "clang++"
4545
},
4646
"condition": {
4747
"type": "equals",

tests/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_executable(unit_tests ${UNIT_TESTS_SOURCES})
1010
set_target_properties(unit_tests PROPERTIES
1111
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
1212
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
13+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
1314
UNITY_BUILD ON
1415
UNITY_BUILD_BATCH_SIZE 20
1516
CXX_STANDARD 23

0 commit comments

Comments
 (0)