XenonRecomp/.github/workflows/cmake-multi-platform.yml
2025-03-03 10:23:11 +01:00

55 lines
1.3 KiB
YAML

name: CMake with Clang and Ninja
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug]
include:
- os: windows-latest
c_compiler: clang-cl
cpp_compiler: clang-cl
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Install Ninja (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ninja-build
shell: bash
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
shell: powershell
- name: Configure CMake
run: >
cmake -B ${{ github.workspace }}/build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S ${{ github.workspace }}
shell: bash
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
shell: bash
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest --build-config ${{ matrix.build_type }}
shell: bash