2021-02-21 05:57:38 -07:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-12-04 10:06:06 -07:00
|
|
|
concurrency:
|
2022-12-04 11:02:22 -07:00
|
|
|
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
|
2022-12-04 10:06:06 -07:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-02-21 05:57:38 -07:00
|
|
|
jobs:
|
2021-03-03 11:05:47 -07:00
|
|
|
Build:
|
|
|
|
name: ${{ matrix.platform.name }}
|
|
|
|
runs-on: ${{ matrix.platform.os }}
|
2021-09-20 06:22:20 -06:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: ${{ matrix.platform.shell }}
|
|
|
|
|
2021-03-03 11:05:47 -07:00
|
|
|
strategy:
|
2021-11-08 19:14:08 -07:00
|
|
|
fail-fast: false
|
2021-03-03 11:05:47 -07:00
|
|
|
matrix:
|
|
|
|
platform:
|
2022-07-30 14:08:07 -06:00
|
|
|
- { 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: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
|
|
|
|
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
|
|
|
|
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
|
2022-11-24 07:50:00 -07:00
|
|
|
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh }
|
|
|
|
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh }
|
|
|
|
- { name: MacOS, os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
|
2021-09-20 06:22:20 -06:00
|
|
|
|
2021-03-03 11:05:47 -07:00
|
|
|
steps:
|
2021-09-20 06:22:20 -06:00
|
|
|
- name: Set up MSYS2
|
|
|
|
if: matrix.platform.shell == 'msys2 {0}'
|
|
|
|
uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
msystem: ${{ matrix.platform.msystem }}
|
|
|
|
install: >-
|
2022-07-30 14:08:07 -06:00
|
|
|
${{ matrix.platform.msys-env }}-cc
|
2021-09-20 06:22:20 -06:00
|
|
|
${{ matrix.platform.msys-env }}-cmake
|
|
|
|
${{ matrix.platform.msys-env }}-ninja
|
|
|
|
${{ matrix.platform.msys-env }}-pkg-config
|
|
|
|
|
2021-03-03 11:05:47 -07:00
|
|
|
- name: Setup Linux dependencies
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-11-24 21:01:49 -07:00
|
|
|
sudo apt-get install build-essential git \
|
2022-07-30 12:41:48 -06:00
|
|
|
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
|
2022-11-22 20:50:20 -07:00
|
|
|
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
|
2022-07-30 12:41:48 -06:00
|
|
|
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
|
|
|
|
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
|
|
|
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
|
|
|
|
|
|
|
|
- name: Setup extra Ubuntu 22.04 dependencies
|
|
|
|
if: matrix.platform.os == 'ubuntu-22.04'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install libpipewire-0.3-dev libdecor-0-dev
|
|
|
|
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Setup Macos dependencies
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: |
|
|
|
|
brew install \
|
|
|
|
ninja
|
2022-10-12 16:51:59 -06:00
|
|
|
- uses: actions/checkout@v3
|
2022-05-04 09:43:59 -06:00
|
|
|
- name: Check that versioning is consistent
|
2022-05-04 12:31:11 -06:00
|
|
|
# We only need to run this once: arbitrarily use the Linux/CMake build
|
2022-11-24 07:50:00 -07:00
|
|
|
if: "runner.os == 'Linux'"
|
2022-09-28 07:37:21 -06:00
|
|
|
run: ./build-scripts/test-versioning.sh
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Configure (CMake)
|
|
|
|
run: |
|
|
|
|
cmake -S . -B build -G Ninja \
|
|
|
|
-DSDL_TESTS=ON \
|
2022-10-05 21:27:37 -06:00
|
|
|
-DSDL_WERROR=ON \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DSDL_INSTALL_TESTS=ON \
|
2022-10-20 13:02:21 -06:00
|
|
|
-DSDL_VENDOR_INFO="Github Workflow" \
|
2022-06-03 11:24:20 -06:00
|
|
|
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
|
2022-07-26 13:24:38 -06:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2022-07-26 13:42:01 -06:00
|
|
|
${{ matrix.platform.cmake }}
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Build (CMake)
|
|
|
|
run: |
|
|
|
|
cmake --build build/ --config Release --verbose --parallel
|
|
|
|
- name: Run build-time tests (CMake)
|
2022-05-04 06:57:30 -06:00
|
|
|
run: |
|
|
|
|
set -eu
|
|
|
|
export SDL_TESTS_QUICK=1
|
|
|
|
ctest -VV --test-dir build/
|
2022-10-21 05:19:59 -06:00
|
|
|
if test "${{ runner.os }}" = "Linux"; then
|
|
|
|
# This should show us the SDL_REVISION
|
2022-11-23 09:33:38 -07:00
|
|
|
strings build/libSDL3.so.0 | grep SDL-
|
2022-10-21 05:19:59 -06:00
|
|
|
fi
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Install (CMake)
|
2022-05-03 13:22:48 -06:00
|
|
|
run: |
|
|
|
|
set -eu
|
2022-06-03 11:24:20 -06:00
|
|
|
cmake --install build/ --config Release
|
2022-11-21 22:36:19 -07:00
|
|
|
echo "SDL3_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
|
2022-11-23 11:18:26 -07:00
|
|
|
( cd cmake_prefix; find . ) | LC_ALL=C sort -u
|
2022-06-03 11:24:20 -06:00
|
|
|
- name: Verify CMake configuration files
|
|
|
|
run: |
|
|
|
|
cmake -S cmake/test -B cmake_config_build -G Ninja \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2022-11-21 22:36:19 -07:00
|
|
|
-DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
|
2022-06-03 11:24:20 -06:00
|
|
|
cmake --build cmake_config_build --verbose
|
2022-11-21 22:36:19 -07:00
|
|
|
- name: Verify sdl3.pc
|
2022-06-16 08:38:58 -06:00
|
|
|
run: |
|
2022-11-21 22:36:19 -07:00
|
|
|
export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
|
2022-06-16 08:38:58 -06:00
|
|
|
cmake/test/test_pkgconfig.sh
|