ci: build with sdl2 and sdl3 #10
Workflow file for this run
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 (MSVC), os: windows-2019, shell: sh, msvc: 1 } | |
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } | |
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } | |
- { name: Linux, os: ubuntu-22.04, shell: sh } | |
- { name: Macos, os: macos-latest, shell: sh } | |
steps: | |
- name: Set up MSYS2 | |
if: ${{ matrix.platform.shell == 'msys2 {0}' }} | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.platform.msystem }} | |
install: >- | |
${{ matrix.platform.msys-env }}-cmake | |
${{ matrix.platform.msys-env }}-gcc | |
${{ matrix.platform.msys-env }}-ninja | |
- name: Setup Macos dependencies | |
if: ${{ runner.os == 'macOS' }} | |
run: | | |
brew install \ | |
ninja \ | |
${NULL+} | |
- name: Setup Linux dependencies | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install \ | |
cmake \ | |
ninja-build \ | |
pkg-config \ | |
${NULL+} | |
- uses: libsdl-org/setup-sdl@main | |
with: | |
version: 2-head | |
- uses: libsdl-org/setup-sdl@main | |
with: | |
version: 3-head | |
- uses: actions/checkout@v3 | |
- uses: seanmiddleditch/gha-setup-ninja@master | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.platform.msvc }} | |
with: | |
arch: x64 | |
- name: Configure (CMake) | |
run: | | |
cmake -S . -B build \ | |
-DSDLGESTURE_TESTS=ON \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=prefix \ | |
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW | |
- name: Build (CMake) | |
run: | | |
cmake --build build/ --config Release --parallel --verbose | |
- name: Install (CMake) | |
run: | | |
set -eu | |
rm -fr prefix_cmake | |
cmake --install build/ --config Release | |
( cd prefix; find . ) | LC_ALL=C sort -u | |
- name: Verify CMake configuration files | |
run: | | |
cmake -S test -B cmake_config_build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_PREFIX_PATH="$PWD/prefix" \ | |
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW | |
cmake --build cmake_config_build --verbose --config Release |