ci: test installed packages using CMake

This commit is contained in:
Anonymous Maarten 2022-06-03 19:24:20 +02:00 committed by Sam Lantinga
parent 96e3733a18
commit f858d1305a
6 changed files with 193 additions and 63 deletions

View File

@ -11,6 +11,21 @@ jobs:
with: with:
version: 2.0.27 version: 2.0.27
- name: Configure CMake - name: Configure CMake
run: emcmake cmake -B build -DCMAKE_VERBOSE_MAKEFILE=ON run: |
emcmake cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build - name: Build
run: cmake --build build/ run: cmake --build build/ --verbose
- name: Install
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
- name: Verify CMake configuration files
if: ${{ false }} # FIXME: cmake/test/CMakeLists.txt should support emscripten
run: |
emcmake cmake -S cmake/test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose

View File

@ -17,9 +17,10 @@ jobs:
platform: platform:
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } - { 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 (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Linux (CMake), os: ubuntu-20.04, shell: sh, flags: -GNinja } - { name: Linux (CMake), os: ubuntu-20.04, shell: sh, flags: true }
- { name: Linux (autotools), os: ubuntu-20.04, shell: sh, autotools: 'true' } - { name: Linux (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
- { name: MacOS, os: macos-latest, shell: sh } - { name: MacOS (CMake), os: macos-latest, shell: sh }
- { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
steps: steps:
- name: Set up MSYS2 - name: Set up MSYS2
@ -79,78 +80,105 @@ jobs:
meson build --buildtype release -Ddemo=false -Ddbus=disabled meson build --buildtype release -Ddemo=false -Ddbus=disabled
ninja -v -C build ninja -v -C build
sudo meson install -C build sudo meson install -C build
- name: Setup Macos dependencies
if: runner.os == 'macOS'
run: |
brew install \
ninja
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Check that versioning is consistent - name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build # We only need to run this once: arbitrarily use the Linux/CMake build
if: "runner.os == 'Linux' && ! matrix.platform.autotools" if: "runner.os == 'Linux' && ! matrix.platform.autotools"
run: ./test/versioning.sh run: ./test/versioning.sh
- name: Configure CMake - name: Configure (CMake)
if: "! matrix.platform.autotools" if: "! matrix.platform.autotools"
run: cmake -B build -DSDL_TEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSDL_INSTALL_TESTS=ON ${{ matrix.platform.flags }} run: |
- name: Build cmake -S . -B build -G Ninja \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release
- name: Build (CMake)
if: "! matrix.platform.autotools" if: "! matrix.platform.autotools"
run: cmake --build build/ --config Release run: |
- name: Run build-time tests cmake --build build/ --config Release --verbose --parallel
- name: Run build-time tests (CMake)
if: "matrix.platform.shell == 'sh' && ! matrix.platform.autotools" if: "matrix.platform.shell == 'sh' && ! matrix.platform.autotools"
run: | run: |
set -eu set -eu
export SDL_TESTS_QUICK=1 export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ ctest -VV --test-dir build/
- name: Install - name: Install (CMake)
if: "matrix.platform.shell == 'sh' && ! matrix.platform.autotools" if: "! matrix.platform.autotools"
run: | run: |
set -eu set -eu
rm -fr DESTDIR-cmake cmake --install build/ --config Release
DESTDIR=$(pwd)/DESTDIR-cmake cmake --install build/ --config Release echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
( cd DESTDIR-cmake; find ) | LC_ALL=C sort -u ( cd cmake_prefix; find ) | LC_ALL=C sort -u
- name: Configure Autotools - name: Configure (Autotools)
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
rm -fr build-autotools rm -fr build-autotools
mkdir build-autotools mkdir build-autotools
./autogen.sh ./autogen.sh
( cd build-autotools && ../configure )
curdir="$(pwd)"
multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
( (
mkdir -p build-autotools/test cd build-autotools
cd build-autotools/test ${{ github.workspace }}/configure \
../../test/configure \ --prefix=${{ github.workspace }}/autotools_prefix \
--x-includes=/usr/include \
--x-libraries="/usr/lib/${multiarch}" \
SDL_CFLAGS="-I${curdir}/include" \
SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
ac_cv_lib_SDL2_ttf_TTF_Init=no \
${NULL+}
) )
- name: Build with Autotools if test "${{ runner.os }}" != "macOS" ; then
curdir="$(pwd)"
multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
(
mkdir -p build-autotools/test
cd build-autotools/test
${{ github.workspace }}/test/configure \
--x-includes=/usr/include \
--x-libraries="/usr/lib/${multiarch}" \
--prefix=${{ github.workspace }}/autotools_prefix \
SDL_CFLAGS="-I${curdir}/include" \
SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
ac_cv_lib_SDL2_ttf_TTF_Init=no \
${NULL+}
)
fi
- name: Build (Autotools)
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1 make -j"${parallel}" -C build-autotools V=1
make -j"${parallel}" -C build-autotools/test V=1 if test "${{ runner.os }}" != "macOS" ; then
- name: Run build-time tests with Autotools make -j"${parallel}" -C build-autotools/test V=1
if: matrix.platform.autotools fi
- name: Run build-time tests (Autotools)
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: | run: |
set -eu set -eu
curdir="$(pwd)" curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1 export SDL_TESTS_QUICK=1
make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs"
- name: Install with Autotools - name: Install (Autotools)
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
curdir="$(pwd)" curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
rm -fr DESTDIR-autotools make -j"${parallel}" -C build-autotools install V=1
mkdir DESTDIR-autotools if test "${{ runner.os }}" != "macOS" ; then
make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools" V=1 make -j"${parallel}" -C build-autotools/test install V=1
make -j"${parallel}" -C build-autotools/test install DESTDIR="${curdir}/DESTDIR-autotools" V=1 fi
( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u ( cd autotools_prefix; find . ) | LC_ALL=C sort -u
- name: Distcheck echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose
- name: Distcheck (Autotools)
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
@ -162,7 +190,7 @@ jobs:
tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz
( cd distcheck/SDL2-* && ./configure ) ( cd distcheck/SDL2-* && ./configure )
make -j"${parallel}" -C distcheck/SDL2-* make -j"${parallel}" -C distcheck/SDL2-*
- name: Run installed-tests from Autotools - name: Run installed-tests (Autotools)
if: "runner.os == 'Linux' && matrix.platform.autotools" if: "runner.os == 'Linux' && matrix.platform.autotools"
run: | run: |
set -eu set -eu

View File

@ -19,14 +19,29 @@ jobs:
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 } - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
- { name: Windows (ARM), flags: -A ARM } - { name: Windows (ARM), flags: -A ARM }
- { name: Windows (ARM64), flags: -A ARM64 } - { name: Windows (ARM64), flags: -A ARM64 }
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TEST=OFF, project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' } - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF,
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure CMake - name: Configure CMake
run: cmake -B build -DSDL_TEST=ON ${{ matrix.platform.flags }} run: cmake -S . -B build `
-DSDL_TESTS=ON `
${{ matrix.platform.flags }} `
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build CMake - name: Build CMake
run: cmake --build build/ --config Release --parallel run: cmake --build build/ --config Release --parallel
- name: Install CMake
run: |
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
cmake --install build/
- name: Verify CMake configuration files
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
run: |
cmake -S cmake/test -B cmake_config_build `
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
${{ matrix.platform.flags }}
cmake --build cmake_config_build --config Release
- name: Add msbuild to PATH - name: Add msbuild to PATH
if: ${{ matrix.platform.project != '' }} if: ${{ matrix.platform.project != '' }}

View File

@ -13,6 +13,24 @@ jobs:
apk update apk update
apk add cmake gmp mpc1 mpfr4 make apk add cmake gmp mpc1 mpfr4 make
- name: Configure CMake - name: Configure CMake
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake -DSDL_TEST=ON run: |
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
-DSDL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build - name: Build
run: cmake --build build run: cmake --build build --config Release
- name: Install
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build --config Release
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build \
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DTEST_SHARED=FALSE \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose

View File

@ -3,26 +3,63 @@ name: Build (RISC OS)
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
autotools: Build:
name: autotools name: ${{ matrix.platform.name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest container: riscosdotinfo/riscos-gccsdk-4.7:latest
steps:
- uses: actions/checkout@v2
- name: Configure
run: ./configure --host=arm-unknown-riscos --disable-gcc-atomics
- name: Build
run: make -j`nproc` V=1
cmake: strategy:
name: CMake fail-fast: false
runs-on: ubuntu-latest matrix:
container: riscosdotinfo/riscos-gccsdk-4.7:latest platform:
- { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries
- { name: CMake }
steps: steps:
- name: Setup dependencies - name: Setup dependencies
run: apt-get update && apt-get install -y cmake ninja-build run: apt-get update && apt-get install -y cmake ninja-build
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Configure CMake - name: Configure (autotools)
run: cmake -S. -Bbuild -G Ninja -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake -DRISCOS=ON -DSDL_GCC_ATOMICS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON if: ${{ contains(matrix.platform.name, 'autotools') }}
- name: Build run: |
run: cmake --build build mkdir build_autotools
cd build_autotools
../configure \
--host=arm-unknown-riscos \
--disable-gcc-atomics \
--prefix=${{ github.workspace }}/prefix_autotools
- name: Build (autotools)
if: ${{ contains(matrix.platform.name, 'autotools') }}
run: make -C build_autotools -j`nproc` V=1
- name: Install (autotools)
if: ${{ contains(matrix.platform.name, 'autotools') }}
run: |
echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV
make -C build_autotools install
( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u
- name: Configure (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
-DRISCOS=ON \
-DSDL_GCC_ATOMICS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake
- name: Build (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: cmake --build build --verbose
- name: Install (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: |
echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV
cmake --install build/
( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.test_args }}
cmake --build cmake_config_build --verbose

View File

@ -16,8 +16,25 @@ jobs:
- name: Install CMake and GNU Make - name: Install CMake and GNU Make
run: | run: |
apk update apk update
apk add cmake make apk add cmake make ninja
- name: Configure CMake - name: Configure CMake
run: cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build - name: Build
run: cmake --build build run: cmake --build build --verbose
- name: Install CMake
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose