mirror of
https://github.com/ScrelliCopter/tmx2gba.git
synced 2025-02-21 03:29:25 +11:00
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
name: CMake
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- ".github/workflows/cmake.yml"
|
|
- "src/**"
|
|
- "ext/**"
|
|
- "CMakeLists.txt"
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
env:
|
|
ARTIFACT_NAME: tmx2gba
|
|
BUILD_TYPE: RelWithDebInfo
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- { name: "MacOS 13.0 Universal", os: macos-13, artifact: macos-universal, arch: arm64;x86_64 }
|
|
- { name: "Windows MSVC x86", os: windows-latest, artifact: windows-x86, arch: x86 }
|
|
- { name: "Windows MSVC x64", os: windows-latest, artifact: windows-x64 }
|
|
- { name: "Windows MSVC ARM64", os: windows-latest, artifact: windows-arm64, arch: amd64_arm64 }
|
|
- { name: "Ubuntu", artifact: "linux", os: ubuntu-latest, extra: "-DUSE_BUNDLED_ZSTD:BOOL=OFF -DUSE_BUNDLED_PUGIXML:BOOL=OFF" }
|
|
runs-on: ${{matrix.config.os}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# Since ninja isn't used it will take less time if this step is skipped
|
|
- uses: lukka/get-cmake@latest
|
|
if: ${{!startsWith(matrix.config.os, 'windows')}}
|
|
- uses: TheMrMilchmann/setup-msvc-dev@v3
|
|
if: ${{startsWith(matrix.config.os, 'windows')}}
|
|
with:
|
|
arch: ${{matrix.config.arch && matrix.config.arch || 'x64'}}
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
if: ${{matrix.config.artifact == 'linux'}}
|
|
with:
|
|
packages: libzstd-dev libpugixml-dev
|
|
version: 1.0
|
|
|
|
- name: Configure CMake
|
|
run: >-
|
|
cmake -B build
|
|
-G "${{startsWith(matrix.config.os, 'windows') && 'NMake Makefiles' || 'Ninja'}}"
|
|
${{(startsWith(matrix.config.os, 'macos') && matrix.config.arch) && format('-DCMAKE_OSX_ARCHITECTURES="{0}"', matrix.config.arch) || ''}}
|
|
${{matrix.config.extra}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
|
|
- name: Build
|
|
run: cmake --build build --config ${{env.BUILD_TYPE}}
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{env.ARTIFACT_NAME}}-${{matrix.config.artifact}}
|
|
path: build/src/${{env.ARTIFACT_NAME}}${{startsWith(matrix.config.os, 'windows') && '.exe' || ''}}
|