Skip to content

Use correct variable. #119

Use correct variable.

Use correct variable. #119

Workflow file for this run

name: Main
on:
push:
paths-ignore:
- '.gitignore'
- '*.md'
jobs:
build:
strategy:
fail-fast: false
matrix:
build_type: ['Debug', 'Release']
config:
- { name: 'macos-universal', os: macos-latest, target: macos }
- { name: 'ios-universal', os: macos-latest, target: ios }
- { name: 'linux-x86_64', os: ubuntu-24.04, target: linux, toolchain_prefix: x86_64-linux-gnu }
- { name: 'linux-x86_32', os: ubuntu-24.04, target: linux, toolchain_prefix: i686-linux-gnu }
- { name: 'linux-arm64', os: ubuntu-24.04, target: linux, toolchain_prefix: aarch64-linux-gnu }
- { name: 'linux-arm32', os: ubuntu-24.04, target: linux, toolchain_prefix: arm-linux-gnueabihf }
- { name: 'windows-x86_64', os: ubuntu-24.04, target: windows, toolchain_prefix: x86_64-w64-mingw32 }
- { name: 'windows-x86_32', os: ubuntu-24.04, target: windows, toolchain_prefix: i686-w64-mingw32 }
- { name: 'android-arm64', os: ubuntu-24.04, target: android, arch: arm64-v8a }
- { name: 'android-arm32', os: ubuntu-24.04, target: android, arch: armeabi-v7a }
- { name: 'android-x86_32', os: ubuntu-24.04, target: android, arch: x86 }
- { name: 'android-x86_64', os: ubuntu-24.04, target: android, arch: x86_64 }
- { name: 'web-wasm32', os: ubuntu-24.04, target: web }
name: ${{ matrix.config.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.config.os }}
steps:
- name: Free disk space (Linux)
if: matrix.config.os == 'ubuntu-24.04'
uses: jlumbroso/free-disk-space@main
with:
android: ${{ matrix.config.target != 'android' }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Base Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
run: brew install ccache ninja libtool
- name: Install Base Dependencies (Linux)
if: matrix.config.os == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y ccache ninja-build mold
- name: Install Dependencies (Linux)
if: matrix.config.target == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y g++-$( echo "${{ matrix.config.toolchain_prefix }}" | sed 's/_/-/i')
- name: Install Dependencies (Windows)
if: matrix.config.target == 'windows'
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
- name: Install Dependencies (Web)
if: matrix.config.target == 'web'
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.64
actions-cache-folder: emsdk-cache
- name: Setup Android NDK (Android)
if: matrix.config.target == 'android'
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27
add-to-path: true
link-to-sdk: true
- name: ccache
uses: hendrikmuhs/[email protected]
with:
max-size: '10G'
key: ${{ matrix.config.name }}-${{ matrix.build_type }}
- name: Configure (Linux)
if: matrix.config.target == 'linux'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Ninja"
-DTOOLCHAIN_PREFIX=${{ matrix.config.toolchain_prefix }}
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/gcc-linux-gnu.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Configure (Windows)
if: matrix.config.target == 'windows'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Ninja"
-DTOOLCHAIN_PREFIX=${{ matrix.config.toolchain_prefix }}
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/gcc-w64-mingw.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Configure (macOS)
if: matrix.config.target == 'macos'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Ninja"
-DPLATFORM=MAC_UNIVERSAL
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/clang-apple.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Configure (iOS)
if: matrix.config.target == 'ios'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Xcode"
-DPLATFORM=OS64COMBINED
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/clang-apple.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Configure (Web)
if: matrix.config.target == 'web'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Ninja"
-DEMSCRIPTEN_SYSTEM_PROCESSOR=riscv64
-DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream//emscripten/cmake/Modules/Platform/Emscripten.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Configure (Android)
if: matrix.config.target == 'android'
run: >
mkdir cmake-build
cmake
-B cmake-build
-G "Ninja"
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake
-DANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}
-DANDROID_ABI=${{ matrix.config.arch }}
-DANDROID_ARM_MODE=arm
-DANDROID_PLATFORM=33
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Build
run: cmake --build cmake-build --config ${{ matrix.build_type }}
- name: Install
run: cmake --install cmake-build --config ${{ matrix.build_type }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.name }}-${{ github.event.repository.name }}-${{ matrix.build_type }}
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: Upload merged artifact
uses: actions/upload-artifact/merge@v4
with:
name: ${{ github.event.repository.name }}
pattern: '*-${{ github.event.repository.name }}-*'