Skip to content

Commit 512ea9c

Browse files
authored
Update cmake-multi-platform.yml
1 parent 05a48bf commit 512ea9c

File tree

1 file changed

+42
-47
lines changed

1 file changed

+42
-47
lines changed
Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,96 @@
1-
name: Omath CI
1+
name: Omath CI (Arch Linux / macOS / Windows)
22

33
on:
44
push:
5-
branches: [ main ] # change if your default branch is not "main"
5+
branches: [ main ]
66
pull_request:
77
branches: [ main ]
88

99
concurrency:
1010
group: ci-${{ github.ref }}
1111
cancel-in-progress: true
1212

13-
################################################################################
14-
# 1) ARCH LINUX – runs inside archlinux:latest container
15-
################################################################################
13+
##############################################################################
14+
# 1) ARCH LINUX – Clang / Ninja (runs in an official Arch container)
15+
##############################################################################
1616
jobs:
1717
arch-build-and-test:
18-
runs-on: ubuntu-latest
19-
container: archlinux:latest
2018
name: Arch Linux (Clang)
19+
runs-on: ubuntu-latest # host runner
20+
container: archlinux:latest # actual build runs inside this container
2121

2222
steps:
23-
# Install Git, Clang, CMake, Ninja, make, etc. *before* we checkout
24-
- name: Install build tools
23+
# --- Install tool-chain **before** checkout so Git is available --------
24+
- name: Install basic tool-chain with pacman
2525
shell: bash
2626
run: |
2727
pacman -Sy --noconfirm archlinux-keyring
2828
pacman -Syu --noconfirm --needed \
2929
git base-devel clang cmake ninja
3030
31-
# Normal checkout with submodules now works because Git is present
32-
- uses: actions/checkout@v4
31+
# --- Now we can safely clone, incl. sub-modules ------------------------
32+
- name: Checkout repository (with sub-modules)
33+
uses: actions/checkout@v4
3334
with:
3435
submodules: recursive
3536

36-
- name: Configure (CMake preset: linux-release)
37+
# --- Configure via CMake preset ---------------------------------------
38+
- name: Configure (cmake --preset)
3739
shell: bash
3840
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON
3941

42+
# --- Build ------------------------------------------------------------
4043
- name: Build
4144
shell: bash
4245
run: cmake --build cmake-build/build/linux-release
4346

44-
- name: Run unit-tests from out/Release
47+
# --- Test -------------------------------------------------------------
48+
- name: Test
4549
shell: bash
46-
run: |
47-
./out/Release/unit_tests
50+
working-directory: cmake-build/build/linux-release
51+
run: ctest --output-on-failure
52+
4853

49-
################################################################################
50-
# 2) macOS – latest Homebrew LLVM/Clang
51-
################################################################################
54+
##############################################################################
55+
# 2) macOS – Clang / Ninja (native runner)
56+
##############################################################################
5257
macos-build-and-test:
58+
name: macOS (Clang)
5359
runs-on: macos-latest
54-
name: macOS (latest Clang)
5560

5661
steps:
57-
- uses: actions/checkout@v4
62+
- name: Checkout repository (with sub-modules)
63+
uses: actions/checkout@v4
5864
with:
5965
submodules: recursive
6066

6167
- name: Install Ninja
6268
uses: seanmiddleditch/gha-setup-ninja@v4
6369

64-
- name: Install latest LLVM/Clang with Homebrew
65-
run: |
66-
brew update
67-
brew install llvm
68-
echo "LLVM_PREFIX=$(brew --prefix llvm)" >> "$GITHUB_ENV"
69-
70-
- name: Configure (preset: darwin-release) using Homebrew Clang
70+
- name: Configure (cmake --preset)
7171
shell: bash
72-
env:
73-
CC: ${{ env.LLVM_PREFIX }}/bin/clang
74-
CXX: ${{ env.LLVM_PREFIX }}/bin/clang++
75-
run: |
76-
cmake --preset darwin-release \
77-
-DCMAKE_C_COMPILER="$CC" \
78-
-DCMAKE_CXX_COMPILER="$CXX" \
79-
-DOMATH_BUILD_TESTS=ON
72+
run: cmake --preset darwin-release -DOMATH_BUILD_TESTS=ON
8073

8174
- name: Build
8275
shell: bash
8376
run: cmake --build cmake-build/build/darwin-release
8477

85-
- name: Run unit-tests from out/Release
78+
- name: Test
8679
shell: bash
87-
run: |
88-
./out/Release/unit_tests
80+
working-directory: cmake-build/build/darwin-release
81+
run: ctest --output-on-failure
82+
8983

90-
################################################################################
91-
# 3) WINDOWS – MSVC
92-
################################################################################
84+
##############################################################################
85+
# 3) Windows MSVC / Ninja (native runner)
86+
##############################################################################
9387
windows-build-and-test:
94-
runs-on: windows-latest
9588
name: Windows (MSVC)
89+
runs-on: windows-latest
9690

9791
steps:
98-
- uses: actions/checkout@v4
92+
- name: Checkout repository (with sub-modules)
93+
uses: actions/checkout@v4
9994
with:
10095
submodules: recursive
10196

@@ -105,15 +100,15 @@ jobs:
105100
- name: Set up MSVC developer command-prompt
106101
uses: ilammy/msvc-dev-cmd@v1
107102

108-
- name: Configure (preset: windows-release)
103+
- name: Configure (cmake --preset)
109104
shell: bash
110105
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON
111106

112107
- name: Build
113108
shell: bash
114109
run: cmake --build cmake-build/build/windows-release
115110

116-
- name: Run unit-tests from out\\Release
111+
- name: Test
117112
shell: bash
118-
run: |
119-
./out/Release/unit_tests.exe
113+
working-directory: cmake-build/build/windows-release
114+
run: ctest --output-on-failure

0 commit comments

Comments
 (0)