mirror of
https://github.com/ScrelliCopter/tmx2gba.git
synced 2025-02-21 03:29:25 +11:00
Compare commits
2 Commits
5d5dda81c9
...
github-tra
| Author | SHA1 | Date | |
|---|---|---|---|
| b9c56ce5a7 | |||
| 0b635ebe87 |
46
.github/workflows/cmake.yml
vendored
46
.github/workflows/cmake.yml
vendored
@@ -2,36 +2,46 @@ name: CMake
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
ARTIFACT_NAME: tmx2gba
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: RelWithDebInfo
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
strategy:
|
||||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
matrix:
|
||||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
config:
|
||||||
runs-on: ubuntu-latest
|
- { 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 }
|
||||||
|
runs-on: ${{matrix.config.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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'}}
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
run: >-
|
||||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
cmake -B build
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
-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
|
- name: Build
|
||||||
# Build your program with the given configuration
|
run: cmake --build build --config ${{env.BUILD_TYPE}}
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
working-directory: ${{github.workspace}}/build
|
|
||||||
# Execute tests defined by the CMake configuration.
|
|
||||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
||||||
run: ctest -C ${{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' || ''}}
|
||||||
|
|||||||
Reference in New Issue
Block a user