bump #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: ${{ matrix.platform.name }} | |
runs-on: ${{ matrix.platform.os }} | |
defaults: | |
run: | |
shell: ${{ matrix.platform.shell }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: 'windows: mingw64', os: 'windows-latest', shell: 'msys2 {0}', msys2: true, msystem: 'mingw64', msys-env: 'mingw-w64-x86_64' } | |
- { name: 'windows: clang32', os: 'windows-latest', shell: 'msys2 {0}', msys2: true, msystem: 'clang32', msys-env: 'mingw-w64-clang-i686' } | |
- { name: 'windows: ucrt64', os: 'windows-latest', shell: 'msys2 {0}', msys2: true, msystem: 'ucrt64', msys-env: 'mingw-w64-ucrt-x86_64'} | |
- { name: 'windows: MSVC (vcvars)', os: 'windows-latest', shell: 'pwsh', msvc: true, msvc_arch: x64 } | |
- { name: 'windows: MSVC (args)', os: 'windows-latest', shell: 'pwsh', msvc: false, cmake-arguments: '-A Win32'} | |
- { name: 'linux: MinGW', os: 'ubuntu-latest', shell: 'bash', cmake-toolchain-file: 'cmake/mingw64.cmake', apt-packages: 'mingw-w64'} | |
- { name: 'macos: default', os: 'macos-latest', shell: 'sh', } | |
steps: | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.platform.msvc }} | |
with: | |
arch: ${{ matrix.platform.msvc_arch }} | |
- name: Set up MSYS2 | |
if: ${{ matrix.platform.msys2 }} | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.platform.msystem }} | |
install: >- | |
${{ matrix.platform.msys-env }}-cc | |
${{ matrix.platform.msys-env }}-cmake | |
${{ matrix.platform.msys-env }}-ninja | |
${{ matrix.platform.msys-env }}-pkg-config | |
- name: Set up apt packages | |
if: ${{ !!matrix.platform.apt-packages }} | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install ${{ matrix.platform.apt-packages }} | |
- uses: actions/checkout@v4 | |
- name: Set up SDL | |
id: sdl | |
uses: libsdl-org/setup-sdl@main | |
with: | |
version: 3-head | |
version-sdl-image: 3-head | |
version-sdl-mixer: 3-head | |
version-sdl-net: 3-head | |
version-sdl-rtf: 3-head | |
version-sdl-ttf: 3-head | |
shell: ${{ matrix.platform.shell }} | |
cmake-arguments: ${{ matrix.platform.cmake-arguments }} | |
cmake-toolchain-file: ${{ matrix.platform.cmake-toolchain-file }} | |
install-linux-dependencies: true | |
sdl-test: true | |
- name: Configure (CMake) | |
run: | | |
cmake -S . -B build ${{ matrix.platform.cmake-arguments }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.platform.cmake-toolchain-file }} | |
- name: Build (CMake) | |
run: | | |
cmake --build build | |
build-docker: | |
name: ${{ matrix.platform.name }} | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.platform.docker }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: 'Fedora (docker)', docker: 'fedora:rawhide', linux: true, | |
prepare: 'sudo dnf install -y gcc g++ cmake' } | |
- { name: 'Ubuntu (docker)', docker: 'ubuntu:23.04', linux: true, | |
prepare: 'apt-get update -y && apt-get install -y build-essential cmake' } | |
- { name: 'vita', docker: 'vitasdk/vitasdk:latest', cmake-toolchain-file: '/usr/local/vitasdk/share/vita.toolchain.cmake', vendored: true, no-sdl-net: true, | |
prepare: 'apk update && apk add cmake ninja pkgconf tar nodejs git' } # cmake-toolchain-file: ${{ env.VITASDK }}/share/vita.toolchain.cmake', | |
- { name: 'n3ds', docker: 'devkitpro/devkitarm:latest', cmake-toolchain-file: '/opt/devkitpro/cmake/3DS.cmake', vendored: true, no-sdl-net: true, args: '-DN3DS=ON -DSDL3MIXER_OPUS=OFF', | |
prepare: 'sudo apt-get update && sudo apt-get install -y cmake ninja-build git nodejs' } # cmake-toolchain-file: '${{ env.DEVKITPRO }}/cmake/3DS.cmake', | |
- { name: 'ps2', docker: 'ps2dev/ps2dev:latest', cmake-toolchain-file: '/usr/local/ps2dev/ps2sdk/ps2dev.cmake', vendored: true, no-sdl-net: true, | |
prepare: 'apk update && apk add cmake gmp mpc1 mpfr4 ninja pkgconf make tar nodejs git' } # cmake-toolchain-file: '${{ env.PS2DEV }}/ps2sdk/ps2dev.cmake', | |
- { name: 'psp', docker: 'pspdev/pspdev:latest', cmake-toolchain-file: '/usr/local/pspdev/psp/share/pspdev.cmake', vendored: true, no-sdl-net: true, | |
prepare: 'apk update && apk add cmake gmp mpc1 mpfr4 ninja pkgconf make tar nodejs git' } # cmake-toolchain-file: '${{ env.PSPDEV }}/psp/share/pspdev.cmake', | |
- { name: 'haiku', docker: 'haiku/cross-compiler:x86_64-r1beta4', cmake-toolchain-file: 'cmake/haiku.cmake', vendored: true, | |
prepare: 'apt-get update && apt-get install pkg-config -y ninja-build tar nodejs git' } | |
steps: | |
- run: | | |
${{ matrix.platform.prepare }} | |
- uses: actions/checkout@v4 | |
- name: Set up SDL | |
uses: libsdl-org/setup-sdl@main | |
with: | |
version: sdl3-head | |
version-sdl-image: 3-head | |
version-sdl-mixer: 3-head | |
version-sdl-net: ${{ (!matrix.platform.no-sdl-net && '3-head') || '' }} | |
version-sdl-rtf: 3-head | |
version-sdl-ttf: 3-head | |
cmake-arguments: ${{ matrix.platform.vendored && '-DSDL2IMAGE_VENDORED=TRUE -DSDL3IMAGE_VENDORED=TRUE -DSDL2MIXER_VENDORED=TRUE -DSDL3MIXER_VENDORED=TRUE -DSDL2TTF_VENDORED=TRUE -DSDL3TTF_VENDORED=TRUE' }} ${{ matrix.platform.args }} | |
cmake-toolchain-file: ${{ matrix.platform.cmake-toolchain-file }} | |
install-linux-dependencies: ${{ !!matrix.platform.linux }} | |
sdl-test: true | |
- name: Configure (CMake) | |
run: | | |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=${{ matrix.platform.cmake-toolchain-file }} -DSDLNET_AVAIlABLE=${{ !matrix.platform.no-sdl-net}} | |
- name: Build (CMake) | |
run: | | |
cmake --build build |