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

91 lines
2.4 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
with:
submodules: recursive
- 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 (Linux)
if: runner.os == 'Linux'
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: bash
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-G Ninja
-S .
shell: powershell
- name: Build (Linux)
if: runner.os == 'Linux'
run: cmake --build build --config ${{ matrix.build_type }}
shell: bash
- name: Build (Windows)
if: runner.os == 'Windows'
run: cmake --build build --config ${{ matrix.build_type }}
shell: powershell
- name: Package Artifacts (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p artifacts
cp build/XenonRecompiler/XenonRecompiler artifacts/
cp build/XenonAnalyse/XenonAnalyse artifacts/
shell: bash
- name: Package Artifacts (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Path artifacts
Copy-Item -Path build\XenonRecompiler\XenonRecompiler.exe -Destination artifacts\
Copy-Item -Path build\XenonAnalyse\XenonAnalyse.exe -Destination artifacts\
shell: powershell
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: XenonBinaries-${{ matrix.os }}
path: artifacts/*