Bump vendored libraries #703
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-latest, shell: sh, vendored: true, cmake: '-GNinja', msvc: 1, shared: 1, static: 0 } | |
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', vendored: false, msystem: mingw64, msys-env: mingw-w64-x86_64, shared: 1, static: 0, | |
cmake: '-DSDL3IMAGE_BACKEND_STB=OFF -DSDL3IMAGE_BACKEND_WIC=OFF -DSDL3IMAGE_AVIF=ON -G "Ninja Multi-Config"' } | |
- { name: Linux, os: ubuntu-latest, shell: sh, vendored: false, cmake: '-GNinja', shared: 1, static: 0, nojxl: true } | |
- { name: 'Linux (static)', os: ubuntu-latest, shell: sh, vendored: true, cmake: '-DBUILD_SHARED_LIBS=OFF -GNinja', shared: 0, static: 1 } | |
- { name: Macos, os: macos-latest, shell: sh, vendored: false, cmake: '-GNinja', shared: 1, static: 0 } | |
steps: | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.platform.msvc }} | |
with: | |
arch: x64 | |
- name: Set up MSYS2 | |
if: ${{ contains(matrix.platform.shell, 'msys2') }} | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.platform.msystem }} | |
path-type: inherit | |
install: >- | |
${{ matrix.platform.msys-env }}-cmake | |
${{ matrix.platform.msys-env }}-gcc | |
${{ matrix.platform.msys-env }}-ninja | |
${{ matrix.platform.msys-env }}-pkg-config | |
${{ matrix.platform.msys-env }}-nasm | |
${{ matrix.platform.msys-env }}-libavif | |
${{ matrix.platform.msys-env }}-libjpeg-turbo | |
${{ matrix.platform.msys-env }}-libjxl | |
${{ matrix.platform.msys-env }}-libpng | |
${{ matrix.platform.msys-env }}-libtiff | |
${{ matrix.platform.msys-env }}-libwebp | |
${{ matrix.platform.msys-env }}-zlib | |
- name: Install Ninja | |
uses: turtlesec-no/get-ninja@main | |
if: ${{ !contains(matrix.platform.shell, 'msys2') }} | |
- name: Set up SDL | |
id: sdl | |
uses: libsdl-org/setup-sdl@main | |
with: | |
cmake-generator: Ninja | |
version: 3-head | |
sdl-test: true | |
shell: ${{ matrix.platform.shell }} | |
- name: Set up Macos dependencies | |
if: ${{ runner.os == 'macOS' && !matrix.platform.vendored }} | |
run: | | |
brew install \ | |
jpeg \ | |
libavif \ | |
libpng \ | |
libtiff \ | |
webp \ | |
zlib \ | |
${NULL+} | |
- name: Set up Linux dependencies | |
if: ${{ runner.os == 'Linux' && !matrix.platform.vendored }} | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install \ | |
libavif-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libtiff-dev \ | |
libwebp-dev \ | |
zlib1g-dev \ | |
${NULL+} | |
- name: Set up NASM | |
uses: ilammy/setup-nasm@v1 | |
if: ${{ matrix.platform.vendored && !contains(matrix.platform.shell, 'msys2') }} | |
- uses: actions/checkout@v3 | |
with: | |
submodules: ${{ matrix.platform.vendored && 'recursive' }} | |
- name: Check that versioning is consistent | |
# We only need to run this once: arbitrarily use the Linux build | |
if: ${{ runner.os == 'Linux' }} | |
run: ./build-scripts/test-versioning.sh | |
- name: Set up CMake 3.16 | |
if: ${{ !matrix.platform.msystem && !matrix.platform.msvc }} | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.16' | |
- name: Configure (CMake) | |
run: | | |
export CMAKE_CONFIGURATION_TYPES=Release | |
cmake -B build \ | |
-DSDL3IMAGE_VENDORED=${{ matrix.platform.vendored }} \ | |
-DBUILD_SHARED_LIBS=ON \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DSDL3IMAGE_SAMPLES=ON \ | |
-DSDL3IMAGE_TESTS=ON \ | |
-DSDL3IMAGE_TESTS_INSTALL=ON \ | |
-DSDL3IMAGE_AVIF=ON \ | |
-DSDL3IMAGE_JXL=${{ !matrix.platform.nojxl }} \ | |
-DSDL3IMAGE_TIF=ON \ | |
-DSDL3IMAGE_WEBP=ON \ | |
-DSDL3IMAGE_WERROR=ON \ | |
-DCMAKE_INSTALL_PREFIX=prefix_cmake \ | |
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=$PWD/build \ | |
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$PWD/build \ | |
${{ matrix.platform.cmake }} | |
- name: Build (CMake) | |
run: cmake --build build/ --config Release --parallel --verbose | |
- name: Run build-time tests | |
run: | | |
sdl_binpath="${{ steps.sdl.outputs.prefix }}/bin" | |
if [ "x${{ runner.os }}" = "xWindows" ]; then | |
sdl_binpath="$( cygpath -u "$sdl_binpath" )" | |
fi | |
echo "sdl_binpath=$sdl_binpath" | |
export PATH="$sdl_binpath:$PATH" | |
export LD_LIBRARY_PATH="$PWD:$LD_LIBRARY_PATH" | |
set -eu | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_AVIF=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_BMP=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_CUR=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_GIF=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_ICO=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_JPG=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_JXL=${{ (matrix.platform.nojxl && '0') || '1' }} | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_LBM=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_PCX=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_PNG=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_PNM=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_QOI=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_SVG=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_TGA=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_TIF=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_WEBP=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_XPM=1 | |
export SDL_IMAGE_TEST_REQUIRE_LOAD_XV=1 | |
export SDL_IMAGE_TEST_REQUIRE_SAVE_JPG=1 | |
export SDL_IMAGE_TEST_REQUIRE_SAVE_PNG=1 | |
cd build | |
ctest --no-tests=error -VV -C Release | |
- name: Install (CMake) | |
if: ${{ matrix.platform.shell == 'sh' || contains(matrix.platform.shell, 'msys2') }} | |
run: | | |
set -eu | |
rm -fr DESTDIR-cmake | |
cmake --install build/ --config Release | |
echo "SDL3_image_ROOT=$(pwd)/prefix_cmake" >> $GITHUB_ENV | |
( cd prefix_cmake; find . ) | LC_ALL=C sort -u | |
- name: Upload artifacts | |
if: ${{ failure() && runner.os == 'Linux' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ matrix.platform.name }} artifacts" | |
path: | | |
build/test/*.bmp | |
build/test/*.jpg | |
build/test/*.png | |
if-no-files-found: ignore | |
- name: Verify CMake configuration files | |
run: | | |
cmake -S cmake/test -B cmake_config_build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DTEST_SHARED=${{ matrix.platform.shared }} \ | |
-DTEST_STATIC=${{ matrix.platform.static }} | |
cmake --build cmake_config_build --verbose |