Skip to content

Update cmake-multi-platform.yml #8

Update cmake-multi-platform.yml

Update cmake-multi-platform.yml #8

name: Omath CI
on:
push:
branches: [ main ] # change if your default branch is not "main"
pull_request:
branches: [ main ]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
################################################################################
# 1) ARCH LINUX – runs inside archlinux:latest container
################################################################################
jobs:
arch-build-and-test:
runs-on: ubuntu-latest
container: archlinux:latest
name: Arch Linux (Clang)
steps:
# Install Git, Clang, CMake, Ninja, make, etc. *before* we checkout
- name: Install build tools
shell: bash
run: |
pacman -Sy --noconfirm archlinux-keyring
pacman -Syu --noconfirm --needed \
git base-devel clang cmake ninja
# Normal checkout with submodules now works because Git is present
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure (CMake preset: linux-release)

Check failure on line 36 in .github/workflows/cmake-multi-platform.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cmake-multi-platform.yml

Invalid workflow file

You have an error in your yaml syntax on line 36
shell: bash
run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON
- name: Build
shell: bash
run: cmake --build cmake-build/build/linux-release
- name: Run unit-tests from out/Release
shell: bash
run: |
./out/Release/unit_tests
################################################################################
# 2) macOS – latest Homebrew LLVM/Clang
################################################################################
macos-build-and-test:
runs-on: macos-latest
name: macOS (latest Clang)
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Install latest LLVM/Clang with Homebrew
run: |
brew update
brew install llvm
echo "LLVM_PREFIX=$(brew --prefix llvm)" >> "$GITHUB_ENV"
- name: Configure (preset: darwin-release) using Homebrew Clang
shell: bash
env:
CC: ${{ env.LLVM_PREFIX }}/bin/clang
CXX: ${{ env.LLVM_PREFIX }}/bin/clang++
run: |
cmake --preset darwin-release \
-DCMAKE_C_COMPILER="$CC" \
-DCMAKE_CXX_COMPILER="$CXX" \
-DOMATH_BUILD_TESTS=ON
- name: Build
shell: bash
run: cmake --build cmake-build/build/darwin-release
- name: Run unit-tests from out/Release
shell: bash
run: |
./out/Release/unit_tests
################################################################################
# 3) WINDOWS – MSVC
################################################################################
windows-build-and-test:
runs-on: windows-latest
name: Windows (MSVC)
steps:
- 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 (preset: windows-release)
shell: bash
run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON
- name: Build
shell: bash
run: cmake --build cmake-build/build/windows-release
- name: Run unit-tests from out\\Release
shell: bash
run: |
./out/Release/unit_tests.exe