2020-11-06 15:09:46 -05:00
name : CI
2023-01-30 15:10:18 -07:00
on : [ push, pull_request, workflow_dispatch]
2020-11-06 15:09:46 -05:00
2023-07-08 20:53:32 -06:00
concurrency :
group : environment-${{github.ref}}
cancel-in-progress : true
2023-03-26 14:21:21 +02:00
env :
2023-04-12 01:37:05 +02:00
DISPLAY : ":99" # Display number to use for the X server
2023-03-26 14:21:21 +02:00
GALLIUM_DRIVER : llvmpipe # Use Mesa 3D software OpenGL renderer
2024-04-14 01:23:36 +02:00
ANDROID_NDK_VERSION : "26.1.10909125" # Android NDK version to use
2023-03-26 14:21:21 +02:00
2023-10-01 22:36:34 -06:00
defaults :
run :
shell : bash
2020-11-06 15:09:46 -05:00
jobs :
build :
2022-02-18 18:30:38 +01:00
name : ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }}
2020-11-06 15:09:46 -05:00
runs-on : ${{ matrix.platform.os }}
2023-10-03 05:52:22 +02:00
env :
CMAKE_CXX_COMPILER_LAUNCHER : ccache # Use ccache to cache C++ compiler output
2024-06-17 22:41:50 -06:00
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK : "1" # Work around Homebrew errors within coverallsapp/github-action@v2
2023-10-03 05:52:22 +02:00
2020-11-06 15:09:46 -05:00
strategy :
2021-02-19 11:04:28 +01:00
fail-fast : false
2020-11-06 15:09:46 -05:00
matrix :
platform :
2024-08-04 11:16:23 -06:00
- { name: Windows VS2019 x86, os: windows-2019, flags : -DSFML_USE_MESA3D=ON -GNinja }
- { name: Windows VS2019 x64, os: windows-2019, flags : -DSFML_USE_MESA3D=ON -GNinja }
- { name: Windows VS2022 x86, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -GNinja }
- { name: Windows VS2022 x64, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -GNinja }
2024-09-13 18:16:37 +02:00
- { name: Windows VS2022 arm64, os: windows-2022, flags : -DSFML_USE_MESA3D=OFF -GNinja -DSFML_BUILD_TEST_SUITE=OFF }
2024-08-04 11:16:23 -06:00
- { name: Windows VS2022 ClangCL MSBuild, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -T ClangCL } # ninja doesn't support specifying the toolset, so use the ClangCL toolset to test building with MSBuild as well
- { name: Windows VS2022 OpenGL ES, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -DSFML_OPENGL_ES=ON -GNinja }
- { name: Windows VS2022 Unity, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -DCMAKE_UNITY_BUILD=ON -GNinja }
2024-12-04 17:42:10 -07:00
- { name: Windows LLVM/Clang, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja }
- { name: Windows MinGW, os: windows-2022, flags : -DSFML_USE_MESA3D=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -GNinja }
2023-04-15 20:50:24 -06:00
- { name: Linux GCC, os: ubuntu-22.04, flags : -GNinja }
2024-12-04 17:42:10 -07:00
- { name: Linux Clang, os: ubuntu-22.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja , gcovr_options : '--gcov-executable="llvm-cov-$CLANG_VERSION gcov"' }
2023-04-15 20:50:24 -06:00
- { name: Linux GCC DRM, os: ubuntu-22.04, flags : -DSFML_USE_DRM=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja }
- { name: Linux GCC OpenGL ES, os: ubuntu-22.04, flags : -DSFML_OPENGL_ES=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja }
2024-10-01 17:10:43 -06:00
- { name: macOS x64, os: macos-13, flags : -GNinja }
- { name: macOS x64 Xcode, os: macos-13, flags : -GXcode }
2023-04-15 20:50:24 -06:00
- { name: macOS arm64, os: macos-14, flags : -GNinja -DSFML_RUN_AUDIO_DEVICE_TESTS=OFF }
2024-10-01 17:10:43 -06:00
- { name: iOS, os: macos-13, flags : -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 }
- { name: iOS Xcode, os: macos-13, flags : -DCMAKE_SYSTEM_NAME=iOS -GXcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO }
2020-11-06 15:09:46 -05:00
config :
2024-08-04 11:16:23 -06:00
- { name: Shared, flags : -DBUILD_SHARED_LIBS=ON }
- { name: Static, flags : -DBUILD_SHARED_LIBS=OFF }
2022-02-18 18:30:38 +01:00
type :
- { name : Release }
2024-08-04 11:16:23 -06:00
- { name: Debug, flags : -DCMAKE_BUILD_TYPE=Debug -DSFML_ENABLE_COVERAGE=ON }
2020-11-06 15:09:46 -05:00
include :
2024-02-08 18:21:33 +01:00
- platform : { name: Windows VS2022 x64, os : windows-2022 }
2024-08-04 11:16:23 -06:00
config : { name: Static with PCH (MSVC), flags : -DSFML_USE_MESA3D=ON -GNinja -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON }
2024-02-08 18:21:33 +01:00
- platform : { name: Linux GCC, os : ubuntu-22.04 }
2024-08-04 11:16:23 -06:00
config : { name: Static with PCH (GCC), flags : -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON }
2024-02-08 18:21:33 +01:00
- platform : { name: Linux Clang, os : ubuntu-22.04 }
2024-12-04 17:42:10 -07:00
config : { name: Static with PCH (Clang), flags : -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON }
2024-06-03 11:33:23 +02:00
- platform : { name: Linux GCC, os : ubuntu-22.04 }
config : { name: Bundled Deps Static, flags : -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_USE_SYSTEM_DEPS=OFF }
- platform : { name: Linux GCC, os : ubuntu-22.04 }
config : { name: Bundled Deps Shared, flags : -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=ON -DSFML_USE_SYSTEM_DEPS=OFF }
2023-09-26 09:03:38 -06:00
- platform : { name: Windows MinGW, os : windows-2022 }
2024-08-04 11:16:23 -06:00
config : { name: Static Standard Libraries, flags : -GNinja -DSFML_USE_MESA3D=ON -DCMAKE_CXX_COMPILER=g++ -DSFML_USE_STATIC_STD_LIBS=ON }
2024-02-08 18:21:33 +01:00
- platform : { name: Windows MinGW, os : windows-2022 }
2024-08-04 11:16:23 -06:00
config : { name: Static with PCH (GCC), flags : -GNinja -DSFML_USE_MESA3D=ON -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON -DSFML_ENABLE_STDLIB_ASSERTIONS=OFF } # disabling stdlib assertions due to false positive
2024-10-01 17:10:43 -06:00
- platform : { name: macOS, os : macos-13 }
2024-08-04 11:16:23 -06:00
config : { name: Frameworks, flags : -GNinja -DSFML_BUILD_FRAMEWORKS=ON -DBUILD_SHARED_LIBS=ON }
2024-10-01 17:10:43 -06:00
- platform : { name: macOS , os : macos-13 }
2024-08-04 11:16:23 -06:00
config : { name: System Deps, flags : -GNinja -DBUILD_SHARED_LIBS=ON -DSFML_USE_SYSTEM_DEPS=ON }
2024-06-04 17:32:06 -06:00
- platform : { name: Android, os : ubuntu-22.04 }
2024-04-14 01:23:36 +02:00
config :
name : x86 (API 21)
2024-08-04 11:16:23 -06:00
flags : -GNinja -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DBUILD_SHARED_LIBS=ON -DCMAKE_ANDROID_STL_TYPE=c++_shared -DSFML_RUN_DISPLAY_TESTS=OFF -DSFML_RUN_AUDIO_DEVICE_TESTS=OFF
2024-04-14 01:23:36 +02:00
arch : x86
api : 21
2023-11-11 12:27:04 +01:00
type : { name : Release }
2024-06-04 17:32:06 -06:00
- platform : { name: Android, os : ubuntu-22.04 }
2024-04-14 01:23:36 +02:00
config :
name : x86_64 (API 24)
2024-08-04 11:16:23 -06:00
flags : -GNinja -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=24 -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DBUILD_SHARED_LIBS=ON -DCMAKE_ANDROID_STL_TYPE=c++_shared -DSFML_RUN_DISPLAY_TESTS=OFF -DSFML_RUN_AUDIO_DEVICE_TESTS=OFF
2024-04-14 01:23:36 +02:00
arch : x86_64
api : 24
2023-11-11 12:27:04 +01:00
type : { name : Release }
2024-06-04 17:32:06 -06:00
- platform : { name: Android, os : ubuntu-22.04 }
2024-04-14 01:23:36 +02:00
config :
name : armeabi-v7a (API 29)
2024-08-04 11:16:23 -06:00
flags : -GNinja -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=29 -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DBUILD_SHARED_LIBS=ON -DCMAKE_ANDROID_STL_TYPE=c++_shared
2024-04-14 01:23:36 +02:00
arch : armeabi-v7a
api : 29
2023-11-11 12:27:04 +01:00
type : { name: Debug, flags : -DCMAKE_BUILD_TYPE=Debug }
2024-06-04 17:32:06 -06:00
- platform : { name: Android, os : ubuntu-22.04 }
2024-04-14 01:23:36 +02:00
config :
name : arm64-v8a (API 33)
2024-08-04 11:16:23 -06:00
flags : -GNinja -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=33 -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DBUILD_SHARED_LIBS=ON -DCMAKE_ANDROID_STL_TYPE=c++_shared -DSFML_RUN_DISPLAY_TESTS=OFF -DSFML_RUN_AUDIO_DEVICE_TESTS=OFF
2024-04-14 01:23:36 +02:00
arch : arm64-v8a
api : 33
2023-11-11 12:27:04 +01:00
type : { name: Debug, flags : -DCMAKE_BUILD_TYPE=Debug }
2024-02-08 18:21:33 +01:00
2020-11-06 15:09:46 -05:00
steps :
- name : Checkout Code
2024-02-15 14:31:31 -07:00
uses : actions/checkout@v4
2020-11-06 15:09:46 -05:00
2023-10-05 00:05:50 +02:00
- name : Set Visual Studio Architecture
if : contains(matrix.platform.name, 'Windows VS') && !contains(matrix.platform.name, 'MSBuild')
uses : ilammy/msvc-dev-cmd@v1
with :
2024-09-13 18:16:37 +02:00
arch : ${{ contains(matrix.platform.name, 'arm64') && 'amd64_arm64' || contains(matrix.platform.name, 'x86') && 'x86' || 'x64' }}
2023-10-05 00:05:50 +02:00
2023-11-04 19:59:47 +01:00
# Although the CMake configuration will run with 3.24 on Windows and 3.22
# elsewhere, we install 3.25 on Windows in order to support specifying
# CMAKE_MSVC_DEBUG_INFORMATION_FORMAT which allows CCache to cache MSVC object
# files, see: https://cmake.org/cmake/help/latest/release/3.25.html#variables
2023-10-03 02:42:53 +02:00
- name : Get CMake and Ninja
uses : lukka/get-cmake@latest
with :
2023-11-04 19:59:47 +01:00
cmakeVersion : ${{ runner.os == 'Windows' && '3.25' || '3.22' }}
2023-10-03 02:42:53 +02:00
ninjaVersion : latest
2023-10-03 05:52:22 +02:00
- name : Install Linux Dependencies and Tools
2022-02-06 05:38:28 +01:00
if : runner.os == 'Linux'
2023-10-03 05:52:22 +02:00
run : |
CLANG_VERSION=$(clang++ --version | sed -n 's/.*version \([0-9]\+\)\..*/\1/p')
echo "CLANG_VERSION=$CLANG_VERSION" >> $GITHUB_ENV
2025-01-02 02:02:09 +01:00
sudo apt-get update && sudo apt-get install xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libopus-dev libopusfile-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb fluxbox ccache gcovr ${{ matrix.platform.name == 'Linux Clang' && 'llvm-$CLANG_VERSION' || '' }}
2020-11-06 15:09:46 -05:00
2023-04-15 20:50:24 -06:00
- name : Remove ALSA Library
if : runner.os == 'Linux' && matrix.platform.name != 'Android'
run : sudo apt-get remove -y libasound2
2020-11-06 15:09:46 -05:00
- name : Install Android Components
if : matrix.platform.name == 'Android'
run : |
2024-01-14 22:28:57 +01:00
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "build-tools;33.0.2"
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125"
2024-04-14 01:23:36 +02:00
ANDROID_NDK_ROOT=$(echo $ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION)
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" >> $GITHUB_ENV
2020-11-06 15:09:46 -05:00
2022-02-18 18:30:38 +01:00
- name : Install macOS Tools
2023-01-28 14:08:54 -07:00
if : runner.os == 'macOS'
2023-03-23 14:13:52 -06:00
run : |
2024-04-12 16:59:06 +02:00
brew update
2023-10-03 05:52:22 +02:00
brew install gcovr ccache || true
2024-10-01 17:10:43 -06:00
- name : Install macOS System Deps
if : contains(matrix.config.name, 'System Deps')
run : brew install flac libvorbis || true
2023-10-03 05:52:22 +02:00
# In addition to installing a known working version of CCache, this action also takes care of saving and restoring the cache for us
# Additionally it outputs information at the end of each job that helps us to verify if the cache is working properly
- name : Setup CCache
2024-02-20 12:47:35 -07:00
uses : hendrikmuhs/ccache-action@v1.2.12
2023-10-03 05:52:22 +02:00
with :
verbose : 2
key : ${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.type.name }}
2023-10-03 02:42:53 +02:00
2024-04-11 20:54:19 +02:00
- name : Install Gcovr for MinGW
if : matrix.type.name == 'Debug' && contains(matrix.platform.name, 'MinGW')
uses : threeal/pipx-install-action@v1.0.0
with :
packages : gcovr
2023-10-03 02:42:53 +02:00
- name : Cache OpenCppCoverage
if : matrix.type.name == 'Debug' && runner.os == 'Windows'
id : opencppcoverage-cache
2024-02-20 12:47:35 -07:00
uses : actions/cache@v4
2023-10-03 02:42:53 +02:00
with :
path : C:\Program Files\OpenCppCoverage
key : opencppcoverage
2022-02-06 05:38:28 +01:00
2023-10-03 02:42:53 +02:00
- name : Install OpenCppCoverage
2024-02-20 12:47:35 -07:00
uses : nick-fields/retry@v3
2023-10-03 02:42:53 +02:00
if : matrix.type.name == 'Debug' && runner.os == 'Windows' && steps.opencppcoverage-cache.outputs.cache-hit != 'true'
2022-11-23 07:35:31 +00:00
with :
max_attempts : 10
timeout_minutes : 3
2023-10-03 02:42:53 +02:00
command : choco install OpenCppCoverage -y
2022-02-06 05:38:28 +01:00
2023-10-03 19:54:55 +02:00
- name : Cache MinGW
2023-10-01 23:17:36 -06:00
if : matrix.platform.name == 'Windows MinGW'
2023-10-03 19:54:55 +02:00
id : mingw-cache
2024-02-20 12:47:35 -07:00
uses : actions/cache@v4
2023-10-03 19:54:55 +02:00
with :
path : "C:\\Program Files\\mingw64"
key : winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5
- name : Install MinGW
if : matrix.platform.name == 'Windows MinGW' && steps.mingw-cache.outputs.cache-hit != 'true'
2023-10-01 23:17:36 -06:00
run : |
2023-10-03 19:54:55 +02:00
curl -Lo mingw64.zip https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-16.0.0-10.0.0-msvcrt-r5/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64msvcrt-10.0.0-r5.zip
unzip -qq -d "C:\Program Files" mingw64.zip
2023-10-01 23:17:36 -06:00
2023-10-03 05:52:22 +02:00
- name : Add OpenCppCoverage and MinGW to PATH and remove MinGW-supplied CCache
2023-10-03 02:42:53 +02:00
if : runner.os == 'Windows'
run : |
2023-10-01 22:36:34 -06:00
echo "C:\Program Files\OpenCppCoverage" >> $GITHUB_PATH
echo "C:\Program Files\mingw64\bin" >> $GITHUB_PATH
2023-10-03 05:52:22 +02:00
rm -f "C:\Program Files\mingw64\bin\ccache.exe"
echo "Using $(which ccache)"
ccache --version
2023-10-03 02:42:53 +02:00
2022-02-18 18:30:38 +01:00
- name : Configure CMake
2023-02-21 16:25:55 -07:00
run : cmake --preset dev -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.type.flags}}
2022-02-06 05:38:28 +01:00
2022-02-18 18:30:38 +01:00
- name : Build
2023-08-09 20:29:42 -06:00
run : cmake --build build --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} --target install
2023-09-19 11:17:29 -06:00
2023-11-11 12:27:04 +01:00
- name : Build Android example
if : matrix.platform.name == 'Android'
run : examples/android/gradlew ${{ matrix.type.name == 'Debug' && 'assembleDebug' || 'assembleRelease' }} -p examples/android -P ARCH_ABI=${{matrix.config.arch}} -P MIN_SDK=${{matrix.config.api}}
2023-04-12 01:37:05 +02:00
- name : Prepare Test
run : |
set -e
# Start up Xvfb and fluxbox to host display tests
if [ "${{ runner.os }}" == "Linux" ]; then
Xvfb $DISPLAY -screen 0 1920x1080x24 &
sleep 5
fluxbox > /dev/null 2>&1 &
sleep 5
fi
# Make sure the build/bin directory exists so that the find command does not fail if no executables are built
2023-08-09 20:29:42 -06:00
mkdir -p build/bin
2023-09-18 20:51:33 -06:00
# Make use of a test to print OpenGL vendor/renderer/version info to the console
find build/bin -name test-sfml-window -or -name test-sfml-window.exe -exec sh -c "{} *sf::Context* --section=\"Version String\" --success | grep OpenGL" \;
2023-03-14 11:51:22 -06:00
2024-04-14 01:23:36 +02:00
- name : Test (Windows)
2024-09-13 18:16:37 +02:00
if : runner.os == 'Windows' && !contains(matrix.platform.name, 'MinGW') && !contains(matrix.platform.name, 'arm64')
2023-09-18 20:51:33 -06:00
run : cmake --build build --target runtests --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
2024-04-14 01:23:36 +02:00
- name : Test (Linux/macOS/MinGW)
2024-04-11 17:38:14 -06:00
if : (runner.os != 'Windows' || contains(matrix.platform.name, 'MinGW')) && !contains(matrix.platform.name, 'iOS') && !contains(matrix.platform.name, 'Android')
2023-09-18 20:51:33 -06:00
run : |
ctest --test-dir build --output-on-failure -C ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} --repeat until-pass:3
# Run gcovr to extract coverage information from the test run
if [ "${{ matrix.type.name }}" == "Debug" ]; then
gcovr -r $GITHUB_WORKSPACE -x build/coverage.out -s -f 'src/SFML/.*' -f 'include/SFML/.*' ${{ matrix.platform.gcovr_options }} $GITHUB_WORKSPACE
fi
2024-04-14 01:23:36 +02:00
2024-04-10 21:37:45 +02:00
- name : Upload Coverage Report to Coveralls
2024-09-13 18:16:37 +02:00
if : matrix.type.name == 'Debug' && github.repository == 'SFML/SFML' && !contains(matrix.platform.name, 'iOS') && !contains(matrix.platform.name, 'Android') && !contains(matrix.platform.name, 'arm64') # Disable upload in forks
2024-04-10 21:37:45 +02:00
uses : coverallsapp/github-action@v2
2022-02-06 05:38:28 +01:00
with :
2024-04-10 21:37:45 +02:00
file : ./build/coverage.out
flag-name : ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }}
parallel : true
allow-empty : true
base-path : ${{ github.workspace }}
2022-02-17 19:32:28 +00:00
2022-09-18 15:24:42 -06:00
- name : Test Install Interface
2023-04-03 22:36:33 +01:00
if : matrix.platform.name != 'Android'
2022-09-18 15:24:42 -06:00
run : |
2024-06-03 11:33:23 +02:00
cmake -S test/install -B test/install/build -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/build/install -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.type.flags}}
2023-08-09 20:29:42 -06:00
cmake --build test/install/build --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
2022-09-18 15:24:42 -06:00
2024-04-10 21:37:45 +02:00
coverage :
name : Finalize Coverage Upload
needs : build
runs-on : ubuntu-22.04
2024-11-19 23:24:33 +01:00
if : github.repository == 'SFML/SFML' # Disable upload in forks
2024-04-10 21:37:45 +02:00
steps :
- name : Coveralls Finished
uses : coverallsapp/github-action@v2
with :
parallel-finished : true
2022-02-17 19:32:28 +00:00
format :
2023-05-20 15:46:47 -06:00
name : Formatting
2024-10-13 16:59:21 -06:00
runs-on : ubuntu-24.04
2022-02-17 19:32:28 +00:00
steps :
2024-10-13 16:59:21 -06:00
- name : Install Clang Format
run : sudo apt-get install clang-format-17
2022-02-17 19:32:28 +00:00
- name : Checkout Code
2024-02-15 14:31:31 -07:00
uses : actions/checkout@v4
2022-02-17 19:32:28 +00:00
- name : Format Code
2024-10-13 16:59:21 -06:00
run : cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-17 -P cmake/Format.cmake
2022-02-17 19:32:28 +00:00
- name : Check Formatting
run : git diff --exit-code
2022-10-16 14:30:13 -06:00
tidy :
name : Analyzing on ${{ matrix.platform.name }}
runs-on : ${{ matrix.platform.os }}
strategy :
fail-fast : false
matrix :
platform :
2023-10-26 15:21:10 -06:00
- { name: Windows, os: windows-2022, flags : -GNinja }
2024-05-20 21:27:29 -06:00
- { name: Linux, os : ubuntu-24.04 }
2024-08-04 11:16:23 -06:00
- { name: Linux DRM, os: ubuntu-24.04, flags : -DSFML_USE_DRM=ON }
2024-05-20 21:27:29 -06:00
- { name: Linux OpenGL ES, os: ubuntu-24.04, flags : -DSFML_OPENGL_ES=ON }
2024-10-01 08:28:31 -06:00
- { name: macOS, os : macos-13 }
- { name: iOS, os: macos-13, flags : -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 }
2024-05-20 21:27:29 -06:00
- { name: Android, os: ubuntu-24.04, flags : -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DCMAKE_ANDROID_STL_TYPE=c++_shared }
2022-10-16 14:30:13 -06:00
steps :
- name : Checkout Code
2024-02-15 14:31:31 -07:00
uses : actions/checkout@v4
2022-10-16 14:30:13 -06:00
2023-10-03 02:42:53 +02:00
- name : Get CMake and Ninja
uses : lukka/get-cmake@latest
with :
cmakeVersion : latest
ninjaVersion : latest
2023-01-13 15:56:42 -07:00
- name : Install Windows Dependencies
if : runner.os == 'Windows'
2023-09-20 17:28:30 -06:00
run : |
curl.exe -o run-clang-tidy https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-15.0.7/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
2023-01-13 15:56:42 -07:00
2022-10-16 14:30:13 -06:00
- name : Install Linux Dependencies
if : runner.os == 'Linux'
2018-01-27 14:26:07 +01:00
run : sudo apt-get update && sudo apt-get install libfreetype-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev
2022-10-16 14:30:13 -06:00
- name : Install macOS Dependencies
if : runner.os == 'macOS'
run : |
2024-04-12 16:59:06 +02:00
brew update
2024-10-01 08:28:31 -06:00
brew install llvm@18 || true
echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH
2022-10-16 14:30:13 -06:00
- name : Configure
2024-12-04 17:42:10 -07:00
run : cmake --preset dev -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_UNITY_BUILD=ON ${{matrix.platform.flags}}
2022-10-16 14:30:13 -06:00
- name : Analyze Code
2023-08-09 20:29:42 -06:00
run : cmake --build build --target tidy
2023-10-26 17:28:40 -06:00
sanitize :
name : Sanitizing on ${{ matrix.platform.name }}
runs-on : ${{ matrix.platform.os }}
strategy :
fail-fast : false
matrix :
platform :
2023-04-15 20:50:24 -06:00
- { name: Linux, os: ubuntu-22.04, flags : }
- { name: Linux DRM, os: ubuntu-22.04, flags : -DSFML_RUN_DISPLAY_TESTS=OFF -DSFML_USE_DRM=ON }
- { name: Linux GCC OpenGL ES, os: ubuntu-22.04, flags : -DSFML_RUN_DISPLAY_TESTS=OFF -DSFML_OPENGL_ES=ON }
2023-10-26 17:28:40 -06:00
steps :
- name : Checkout Code
2024-02-15 14:31:31 -07:00
uses : actions/checkout@v4
2023-10-26 17:28:40 -06:00
- name : Get CMake and Ninja
uses : lukka/get-cmake@latest
with :
cmakeVersion : latest
ninjaVersion : latest
- name : Install Linux Dependencies
if : runner.os == 'Linux'
2018-01-27 14:26:07 +01:00
run : sudo apt-get update && sudo apt-get install xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb fluxbox && sudo apt-get remove -y libasound2
2023-10-26 17:28:40 -06:00
- name : Configure
2024-12-04 17:42:10 -07:00
run : cmake --preset dev -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSFML_BUILD_EXAMPLES=OFF -DSFML_ENABLE_SANITIZERS=ON ${{matrix.platform.flags}}
2023-10-26 17:28:40 -06:00
- name : Build
run : cmake --build build
- name : Prepare Test
run : |
set -e
# Start up Xvfb and fluxbox to host display tests
if [ "${{ runner.os }}" == "Linux" ]; then
Xvfb $DISPLAY -screen 0 1920x1080x24 &
sleep 5
fluxbox > /dev/null 2>&1 &
sleep 5
fi
- name : Test
run : ctest --test-dir build --output-on-failure
2024-08-30 10:14:27 -06:00
docs :
name : Documentation
2024-09-11 08:56:43 -06:00
runs-on : macos-14
2024-08-30 10:14:27 -06:00
steps :
- name : Install Doxygen
2024-09-11 08:56:43 -06:00
run : |
brew update
brew install doxygen || true
2024-08-30 10:14:27 -06:00
- name : Checkout
uses : actions/checkout@v4
- name : Configure
2024-06-03 11:33:23 +02:00
run : cmake -B build -DSFML_BUILD_DOC=ON -DSFML_BUILD_WINDOW=OFF -DSFML_BUILD_GRAPHICS=OFF -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF
2024-08-30 10:14:27 -06:00
- name : Build Doxygen Site
run : cmake --build build --target doc