Skip to content

Updated version to 1.6 #761

Updated version to 1.6

Updated version to 1.6 #761

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-22.04
env:
GCC_VERSION: 12
CLANG_VERSION: 14
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo add-apt-repository --yes ppa:texus/raylib
sudo apt-get update
sudo apt-get -y install g++-$GCC_VERSION clang-$CLANG_VERSION clang-tidy-$CLANG_VERSION ninja-build cppcheck
sudo apt-get -y install libsfml-dev libsdl2-dev libsdl2-ttf-dev libglfw3-dev libraylib5-dev
- name: Build TGUI (recent gcc)
run: >
cmake -B TGUI-build-gcc -GNinja
-DCMAKE_CXX_CPPCHECK="cppcheck;--enable=all;--inline-suppr;--quiet;--suppress=*:*/extlibs/*;--suppress=preprocessorErrorDirective;--suppress=noExplicitConstructor;--suppress=unmatchedSuppression;--suppress=missingIncludeSystem;--suppress=useStlAlgorithm;--suppress=passedByValue;--suppress=unusedFunction;--suppress=virtualCallInConstructor"
-DCMAKE_INSTALL_PREFIX=TGUI-build-gcc/install
-DCMAKE_CXX_COMPILER=g++-$GCC_VERSION
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DCMAKE_UNITY_BUILD=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-gcc --config Debug --target install
- name: Build TGUI (recent clang)
run: >
cmake -B TGUI-build-clang -GNinja
-DCMAKE_CXX_COMPILER=clang++-$CLANG_VERSION
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-clang --config Release
- name: Test TGUIConfig.cmake
run: |
cmake -GNinja -DTGUI_DIR="$GITHUB_WORKSPACE/TGUI-build-gcc/install/lib/cmake/TGUI/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
test -e tests/cmake/build/TguiTest
#----------------------------------------
linux-latest-dev:
runs-on: ubuntu-20.04
env:
SFML_GITHUB_URL: https://github.com/SFML/SFML
SDL_GITHUB_URL: https://github.com/libsdl-org/SDL
SDL_TTF_GITHUB_URL: https://github.com/libsdl-org/SDL_ttf
GLFW_GITHUB_URL: https://github.com/glfw/glfw
RAYLIB_GITHUB_URL: https://github.com/raysan5/raylib
CMAKE_VERSION: 3.27
CMAKE_VERSION_PATCH: 4
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
with:
path: TGUI
- name: Lookup dependency versions
id: find-dependencies
run: |
echo "sfml-revision=$(git ls-remote $SFML_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "sdl-revision=$(git ls-remote $SDL_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "sdl-ttf-revision=$(git ls-remote $SDL_TTF_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "glfw-revision=$(git ls-remote $GLFW_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "raylib-revision=$(git ls-remote $RAYLIB_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_LINUX_SFML_LATEST_${{ steps.find-dependencies.outputs.sfml-revision }}
- name: Cache SDL
uses: actions/cache@v4
id: cache-sdl
with:
path: SDL_INSTALL
key: CACHE_LINUX_SDL_LATEST_${{ steps.find-dependencies.outputs.sdl-revision }}
- name: Cache SDL_ttf
uses: actions/cache@v4
id: cache-sdl-ttf
with:
path: SDL_TTF_INSTALL
key: CACHE_LINUX_SDL_TTF_LATEST_${{ steps.find-dependencies.outputs.sdl-ttf-revision }}
- name: Cache GLFW
uses: actions/cache@v4
id: cache-glfw
with:
path: GLFW_INSTALL
key: CACHE_LINUX_GLFW_LATEST_${{ steps.find-dependencies.outputs.glfw-revision }}
- name: Cache raylib
uses: actions/cache@v4
id: cache-raylib
with:
path: RAYLIB_INSTALL
key: CACHE_LINUX_RAYLIB_LATEST_${{ steps.find-dependencies.outputs.raylib-revision }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install xorg-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype-dev ninja-build libwayland-dev libxkbcommon-dev
sudo sh -c 'wget -nv -O- "https://cmake.org/files/v${{env.CMAKE_VERSION}}/cmake-${{env.CMAKE_VERSION}}.${{env.CMAKE_VERSION_PATCH}}-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local'
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $SFML_GITHUB_URL SFML
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S SFML -B SFML-build
cmake --build SFML-build --config Debug --target install
- name: Build SDL
if: steps.cache-sdl.outputs.cache-hit != 'true'
run: |
git clone --single-branch --depth 1 $SDL_GITHUB_URL SDL
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_INSTALL -DBUILD_SHARED_LIBS=ON -S SDL -B SDL-build
cmake --build SDL-build --config Debug --target install
- name: Build SDL_ttf
if: steps.cache-sdl-ttf.outputs.cache-hit != 'true'
run: |
git clone --recurse-submodules --single-branch --depth 1 $SDL_TTF_GITHUB_URL SDL_TTF
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_TTF_INSTALL -DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3" -DBUILD_SHARED_LIBS=ON -S SDL_TTF -B SDL_TTF-build
cmake --build SDL_TTF-build --config Debug --target install
- name: Build GLFW
if: steps.cache-glfw.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $GLFW_GITHUB_URL GLFW
cmake -GNinja -DCMAKE_INSTALL_PREFIX=GLFW_INSTALL -DBUILD_SHARED_LIBS=ON -S GLFW -B GLFW-build
cmake --build GLFW-build --config Debug --target install
- name: Build raylib
if: steps.cache-raylib.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $RAYLIB_GITHUB_URL raylib
cmake -GNinja -DCMAKE_INSTALL_PREFIX=RAYLIB_INSTALL -DBUILD_SHARED_LIBS=ON -S raylib -B raylib-build
cmake --build raylib-build --config Debug --target install
- name: Build TGUI
working-directory: TGUI
run: >
CXXFLAGS="-fprofile-arcs -ftest-coverage -DTGUI_REMOVE_DEPRECATED_CODE"
cmake -B build
-DSFML_ROOT="$GITHUB_WORKSPACE/SFML_INSTALL"
-DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3/"
-DSDL3_ttf_DIR="$GITHUB_WORKSPACE/SDL_TTF_INSTALL/lib/cmake/SDL3_ttf/"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Debug
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_ENABLE_DRAW_TESTS=ON
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
sudo make -C build -j$(nproc) install
- name: Run tests
working-directory: TGUI/build/tests
run: |
set -a && source ../../tests/EnableSoftwareRenderer.env && set +a
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SFML_GRAPHICS
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SFML_OPENGL3
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_RENDERER
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=RAYLIB
MESA_GL_VERSION_OVERRIDE=3.3 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_OPENGL3
MESA_GLES_VERSION_OVERRIDE=3.2 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_GLES2
MESA_GL_VERSION_OVERRIDE=4.1 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_TTF_OPENGL3
MESA_GLES_VERSION_OVERRIDE=3.0 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_TTF_GLES2
MESA_GL_VERSION_OVERRIDE=4.5 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=GLFW_OPENGL3
MESA_GLES_VERSION_OVERRIDE=2.0 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=GLFW_GLES2
- name: Test TGUIConfig.cmake
working-directory: TGUI
run: >
cmake -GNinja -S tests/cmake -B tests/cmake/build
-DSFML_ROOT="$GITHUB_WORKSPACE/SFML_INSTALL/"
-DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3/"
-DSDL3_ttf_DIR="$GITHUB_WORKSPACE/SDL_TTF_INSTALL/lib/cmake/SDL3_ttf/"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
cmake --build tests/cmake/build --config Release
test -e tests/cmake/build/TguiTest
- name: Upload coverage reports to Codecov
working-directory: TGUI
run: |
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -ga "-pr" -t ${{secrets.CODECOV_TOKEN}}
#----------------------------------------
linux-oldest:
runs-on: ubuntu-20.04
env:
SFML_VERSION: 2.5.1 # 2.5.0 has issue with mesa
SDL_VERSION: 2.0.18 # older versions aren't supported in SDL_RENDERER backend
SDL_TTF_VERSION: 2.0.15 # 2.0.14 has no cmake script
GLFW_VERSION: '3.2'
RAYLIB_VERSION: '4.2.0'
CMAKE_VERSION: '3.16'
CMAKE_VERSION_PATCH: 0
GCC_VERSION: 7
CLANG_VERSION: '6.0'
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_LINUX_OLDEST_SFML_${{env.SFML_VERSION}}
- name: Cache SDL
uses: actions/cache@v4
id: cache-sdl
with:
path: SDL_INSTALL
key: CACHE_LINUX_OLDEST_SDL_${{env.SDL_VERSION}}
- name: Cache SDL_ttf
uses: actions/cache@v4
id: cache-sdl-ttf
with:
path: SDL_TTF_INSTALL
key: CACHE_LINUX_OLDEST_SDL_TTF_${{env.SDL_TTF_VERSION}}
- name: Cache GLFW
uses: actions/cache@v4
id: cache-glfw
with:
path: GLFW_INSTALL
key: CACHE_LINUX_OLDEST_GLFW_${{env.GLFW_VERSION}}
- name: Cache raylib
uses: actions/cache@v4
id: cache-raylib
with:
path: RAYLIB_INSTALL
key: CACHE_LINUX_OLDEST_RAYLIB_${{env.RAYLIB_VERSION}}
- name: Install build tools and dependencies
run: |
sudo apt-get update
sudo apt-get -y install g++-$GCC_VERSION clang-$CLANG_VERSION ninja-build
sudo apt-get -y install xorg-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype6-dev
sudo sh -c 'wget -nv -O- "https://cmake.org/files/v${{env.CMAKE_VERSION}}/cmake-${{env.CMAKE_VERSION}}.${{env.CMAKE_VERSION_PATCH}}-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local'
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
mkdir SFML
wget -nv -O- "https://github.com/SFML/SFML/archive/refs/tags/$SFML_VERSION.tar.gz" | tar --strip-components=1 -xz -C SFML
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S SFML -B SFML-build
cmake --build SFML-build --config Release --target install
- name: Build SDL
if: steps.cache-sdl.outputs.cache-hit != 'true'
run: |
mkdir SDL
wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/tags/release-$SDL_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_INSTALL -DBUILD_SHARED_LIBS=ON -S SDL -B SDL-build
cmake --build SDL-build --config Release --target install
- name: Build SDL_ttf
if: steps.cache-sdl-ttf.outputs.cache-hit != 'true'
run: |
mkdir SDL_TTF
wget -nv -O- "https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-$SDL_TTF_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL_TTF
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_TTF_INSTALL -DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2" -DBUILD_SHARED_LIBS=ON -S SDL_TTF -B SDL_TTF-build
cmake --build SDL_TTF-build --config Release --target install
- name: Build GLFW
if: steps.cache-glfw.outputs.cache-hit != 'true'
run: |
mkdir GLFW
wget -nv -O- "https://github.com/glfw/glfw/archive/refs/tags/$GLFW_VERSION.tar.gz" | tar --strip-components=1 -xz -C GLFW
cmake -GNinja -DCMAKE_INSTALL_PREFIX=GLFW_INSTALL -DBUILD_SHARED_LIBS=ON -S GLFW -B GLFW-build
cmake --build GLFW-build --config Release --target install
- name: Build raylib
if: steps.cache-raylib.outputs.cache-hit != 'true'
run: |
mkdir raylib
wget -nv -O- "https://github.com/raysan5/raylib/archive/refs/tags/$RAYLIB_VERSION.tar.gz" | tar --strip-components=1 -xz -C raylib
cmake -GNinja -DCMAKE_INSTALL_PREFIX=RAYLIB_INSTALL -DBUILD_SHARED_LIBS=ON -S raylib -B raylib-build
cmake --build raylib-build --config Release --target install
- name: Build TGUI (old gcc)
run: >
cmake -B TGUI-build-gcc -GNinja
-DCMAKE_CXX_COMPILER=g++-$GCC_VERSION
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-gcc --config Release
- name: Build TGUI (old clang)
run: >
cmake -B TGUI-build-clang -GNinja
-DCMAKE_CXX_COMPILER=clang++-$CLANG_VERSION
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
sudo cmake --build TGUI-build-clang --config Debug --target install
- name: Test TGUIConfig.cmake
run: >
cmake -GNinja -S tests/cmake -B tests/cmake/build
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
cmake --build tests/cmake/build --config Debug
test -e tests/cmake/build/TguiTest
#----------------------------------------
linux-per-backend:
runs-on: ubuntu-22.04
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo add-apt-repository --yes ppa:texus/raylib
sudo apt-get update
sudo apt-get -y install ninja-build libsfml-dev libsdl2-dev libsdl2-ttf-dev libglfw3-dev libraylib5-dev
- name: Build TGUI (SFML_GRAPHICS)
run: >
cmake -B TGUI-build-SFML_GRAPHICS -GNinja
-DBUILD_SHARED_LIBS=OFF
-DSFML_STATIC_LIBRARIES=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SFML_GRAPHICS
sudo cmake --build TGUI-build-SFML_GRAPHICS --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
- name: Build TGUI (SDL_RENDERER)
run: >
cmake -B TGUI-build-SDL_RENDERER -GNinja
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_RENDERER
sudo cmake --build TGUI-build-SDL_RENDERER --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (SDL_TTF_GLES2)
run: >
cmake -B TGUI-build-SDL_TTF_GLES2 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_TTF_GLES2
sudo cmake --build TGUI-build-SDL_TTF_GLES2 --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (SDL_OPENGL3)
run: >
cmake -B TGUI-build-SDL_OPENGL3 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=23
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_OPENGL3
sudo cmake --build TGUI-build-SDL_OPENGL3 --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
- name: Build TGUI (GLFW_OPENGL3)
run: >
cmake -B TGUI-build-GLFW_OPENGL3 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=GLFW_OPENGL3
sudo cmake --build TGUI-build-GLFW_OPENGL3 --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (RAYLIB)
run: >
cmake -B TGUI-build-RAYLIB -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=RAYLIB
sudo cmake --build TGUI-build-RAYLIB --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
#----------------------------------------
windows: # Setup technically not allowed, backends have conflicting FreeType dependencies
runs-on: windows-2022
env:
SFML_VERSION: 2.6.0
SDL_VERSION: 2.28.3
SDL_TTF_VERSION: 2.20.2
GLFW_VERSION: '3.4'
RAYLIB_VERSION: '5.0'
FREETYPE_VERSION: 2.13.2
MSVC_TOOLSET_VERSION: 143 # VS2022
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/releases/download/${env:SFML_VERSION}/SFML-${env:SFML_VERSION}-windows-vc17-32-bit.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/libsdl-org/SDL/releases/download/release-${env:SDL_VERSION}/SDL2-devel-${env:SDL_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/libsdl-org/SDL_ttf/releases/download/release-${env:SDL_TTF_VERSION}/SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/glfw/glfw/releases/download/${env:GLFW_VERSION}/glfw-${env:GLFW_VERSION}.bin.WIN32.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/raysan5/raylib/releases/download/${env:RAYLIB_VERSION}/raylib-${env:RAYLIB_VERSION}_win32_msvc16.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x SFML-${env:SFML_VERSION}-windows-vc17-32-bit.zip
7z x SDL2-devel-${env:SDL_VERSION}-VC.zip
7z x SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
7z x glfw-${env:GLFW_VERSION}.bin.WIN32.zip
7z x raylib-${env:RAYLIB_VERSION}_win32_msvc16.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
cmake -B TGUI-build -T v${env:MSVC_TOOLSET_VERSION} -A Win32
-DSFML_ROOT="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/"
-DSDL2_DIR="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}/cmake/"
-DSDL2_ttf_DIR="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}/cmake/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/lib-vc2022/glfw3dll.lib"
-Draylib_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/include"
-Draylib_LIBRARY="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/lib/raylibdll.lib"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DCMAKE_UNITY_BUILD=OFF
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=23
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build --config Debug --target install
- name: Test TGUIConfig.cmake
run: >
cmake -T v${env:MSVC_TOOLSET_VERSION} -A Win32 -S tests/cmake -B tests/cmake/build
-DTGUI_ROOT="${env:GITHUB_WORKSPACE}/TGUI-build/install"
-DSFML_ROOT="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}"
-DSDL2_DIR="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}/cmake/"
-DSDL2_ttf_DIR="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}/cmake/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/lib-vc2022/glfw3dll.lib"
-Draylib_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/include"
-Draylib_LIBRARY="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/lib/raylibdll.lib"
cmake --build tests/cmake/build --config Debug
#----------------------------------------
windows-oldest: # Setup technically not allowed, backends have conflicting FreeType dependencies (linking statically won't even work)
runs-on: windows-2019
env:
SFML_VERSION: 2.5.0
SDL_VERSION: 2.0.6
SDL_TTF_VERSION: 2.0.14
FREETYPE_VERSION: 2.6.5
CMAKE_VERSION: 3.17
CMAKE_VERSION_PATCH: 5
MSVC_TOOLSET_VERSION: 141 # VS2017
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://cmake.org/files/v${env:CMAKE_VERSION}/cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86.zip
C:\msys64\usr\bin\wget.exe -nv https://www.sfml-dev.org/files/SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip
C:\msys64\usr\bin\wget.exe -nv https://libsdl.org/release/SDL2-devel-${env:SDL_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86.zip
7z x SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip
7z x SDL2-devel-${env:SDL_VERSION}-VC.zip
7z x SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe"
-B TGUI-build -T "v${env:MSVC_TOOLSET_VERSION}" -A Win32
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DSDL2_PATH="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}"
-DSDL2_TTF_PATH="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DTGUI_OPTIMIZE_SINGLE_BUILD=ON
-DTGUI_OPTIMIZE_SINGLE_BUILD_THREADS=2
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe" --build TGUI-build --config Release --target install
- name: Test TGUIConfig.cmake
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe"
-T "v${env:MSVC_TOOLSET_VERSION}" -A Win32 -S tests/cmake -B tests/cmake/build
-DTGUI_DIR="${env:GITHUB_WORKSPACE}/TGUI-build/install/lib/cmake/TGUI/"
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DSDL2_PATH="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}"
-DSDL2_TTF_PATH="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}"
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe" --build tests/cmake/build --config Release
#----------------------------------------
windows-clang:
runs-on: windows-2022
env:
SFML_VERSION: 2.6.1
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: |
SFML_INSTALL_CLANG_CL
SFML_INSTALL_LLVM_CLANG
key: CACHE_WINDOWS_CLANG_SFML_${{env.SFML_VERSION}}
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/archive/refs/tags/${env:SFML_VERSION}.zip
7z x "${env:SFML_VERSION}.zip"
cmake -T ClangCL -A x64 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL_CLANG_CL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build-ClangCL
cmake --build SFML-build-ClangCL --config Release --target install
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -A Win32 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL_LLVM_CLANG -DBUILD_SHARED_LIBS=OFF -DSFML_USE_STATIC_STD_LIBS=OFF -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build-LLVM-Clang
cmake --build SFML-build-LLVM-Clang --config Debug --target install
- name: Build TGUI (ClangCL)
run: >
cmake -B TGUI-build-ClangCL -T ClangCL -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL_CLANG_CL/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-ClangCL --config Release
- name: Build TGUI (LLVM Clang)
run: >
cmake -B TGUI-build-LLVM-Clang -A Win32
-DCMAKE_CXX_COMPILER=clang++
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL_LLVM_CLANG/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-LLVM-Clang --config Debug
- name: Run tests
working-directory: TGUI-build-LLVM-Clang/tests/Debug
run: ./tests.exe
#----------------------------------------
windows-static-mt:
runs-on: windows-2019
env:
SFML_VERSION: 2.5.1
GLFW_VERSION: 3.3.10
FREETYPE_VERSION: 2.11.1
CMAKE_VERSION: 3.19
CMAKE_VERSION_PATCH: 8
MSVC_TOOLSET_VERSION: 142 # VS2019
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_WINDOWS_STATIC_MT_SFML_${{env.SFML_VERSION}}
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/archive/refs/tags/${env:SFML_VERSION}.zip
7z x "${env:SFML_VERSION}.zip"
cmake -T "v${env:MSVC_TOOLSET_VERSION}" -A x64 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=OFF -DSFML_USE_STATIC_STD_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build
cmake --build SFML-build --config Release --target install
- name: Download dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://cmake.org/files/v${env:CMAKE_VERSION}/cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/glfw/glfw/releases/download/${env:GLFW_VERSION}/glfw-${env:GLFW_VERSION}.bin.WIN64.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64.zip
7z x glfw-${env:GLFW_VERSION}.bin.WIN64.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe"
-B TGUI-build -T "v${env:MSVC_TOOLSET_VERSION}" -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL/lib/cmake/SFML/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/lib-vc2019/glfw3_mt.lib"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_USE_STATIC_STD_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe" --build TGUI-build --config Release --target install
- name: Test TGUIConfig.cmake
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe"
-T "v${env:MSVC_TOOLSET_VERSION}" -A x64 -S tests/cmake -B tests/cmake/build
-DTGUI_ROOT="${env:GITHUB_WORKSPACE}/TGUI-build/install"
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL/lib/cmake/SFML/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/lib-vc2019/glfw3_mt.lib"
-DFREETYPE_INCLUDE_DIR_ft2build="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include"
-DFREETYPE_INCLUDE_DIR_freetype2="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include"
-DFREETYPE_LIBRARY="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/release static/vs2015-2022/win64/freetype.lib"
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe" --build tests/cmake/build --config Release
#----------------------------------------
macos:
runs-on: macos-latest
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install sfml sdl2 sdl2_ttf glfw ninja raylib
- name: Build TGUI (dylibs)
run: >
cmake -B TGUI-build-dylibs -GNinja
-DCMAKE_INSTALL_PREFIX=TGUI-build-dylibs/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_BUILD_FRAMEWORK=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-dylibs --config Debug --target install
cmake -GNinja -DTGUI_ROOT="$GITHUB_WORKSPACE/TGUI-build-dylibs/install/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (frameworks)
run: >
cmake -B TGUI-build-framework -GNinja
-DCMAKE_INSTALL_PREFIX=TGUI-build-frameworks/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_BUILD_FRAMEWORK=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-framework --config Release --target install
cmake -GNinja -DTGUI_ROOT="$GITHUB_WORKSPACE/TGUI-build-frameworks/install/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
#----------------------------------------
android-sdl:
runs-on: ubuntu-latest
env:
SDL_VERSION: 2.30.7 # Not released yet, so code below downloads latest version and ignores this for now
SDL_TTF_VERSION: 2.22.0
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
with:
path: TGUI
# TODO (once SDL 2.30.7 is released: wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/tags/release-$SDL_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL2
- name: Download SDL
run: |
mkdir SDL2
mkdir SDL2_ttf
wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/heads/release-2.30.x.tar.gz" | tar --strip-components=1 -xz -C SDL2
wget -nv -O- "https://github.com/libsdl-org/SDL_ttf/releases/download/release-$SDL_TTF_VERSION/SDL2_ttf-$SDL_TTF_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL2_ttf
- name: Build SDL_RENDERER project
working-directory: TGUI/examples/android/SDL_RENDERER
run: |
sed -i "s/^\(\s*\)abiFilters .*$/\1abiFilters 'arm64-v8a'/" app/build.gradle
sed -i "s/^\(\s*\)ndkVersion .*$/\1ndkVersion '${ANDROID_NDK_ROOT##*/}'/" app/build.gradle
./gradlew assembleRelease --info
- name: Build SDL_TTF_GLES2 project
working-directory: TGUI/examples/android/SDL_TTF_GLES2
run: |
cmake -DTGUI_BACKEND=Custom -S ../../.. -B TGUI-build
sed -i "s/^\(\s*\)abiFilters .*$/\1abiFilters 'x86_64'/" app/build.gradle
sed -i "s/^\(\s*\)ndkVersion .*$/\1ndkVersion '${ANDROID_NDK_ROOT##*/}'/" app/build.gradle
ln -s $GITHUB_WORKSPACE/SDL2 app/jni/SDL
ln -s $GITHUB_WORKSPACE/SDL2_ttf app/jni/SDL_TTF
ln -s $GITHUB_WORKSPACE/TGUI app/jni/TGUI
./gradlew assembleDebug --info
#----------------------------------------
android-sfml-graphics:
runs-on: ubuntu-latest
env:
SFML_VERSION: 2.6.0
ARCH_ABI: arm64-v8a
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: |
SFML
SFML-build
key: CACHE_ANDROID_SFML_${{env.SFML_VERSION}}_ARCH_${{env.ARCH_ABI}}
- name: Install Android NDK
run: |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125"
ANDROID_NDK_ROOT=$(echo $ANDROID_SDK_ROOT/ndk/26.1.10909125)
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" >> $GITHUB_ENV
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
mkdir SFML
wget -nv -O- "https://github.com/SFML/SFML/archive/refs/tags/${SFML_VERSION}.tar.gz" | tar --strip-components=1 -xz -C SFML
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=23 -DCMAKE_ANDROID_NDK=${ANDROID_NDK_ROOT} -DCMAKE_ANDROID_ARCH_ABI=$ARCH_ABI -DCMAKE_ANDROID_STL_TYPE=c++_shared -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=OFF -S SFML -B SFML-build
make -C SFML-build -j$(nproc)
- name: Install SFML into NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
working-directory: SFML-build
run: |
make install
- name: Build TGUI
run: >
cmake -B TGUI-build
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_SYSTEM_VERSION=23
-DCMAKE_ANDROID_NDK=${ANDROID_NDK_ROOT}
-DCMAKE_ANDROID_ARCH_ABI=$ARCH_ABI
-DCMAKE_ANDROID_STL_TYPE=c++_shared
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Debug
-DTGUI_BACKEND=SFML_GRAPHICS
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
make -C TGUI-build -j$(nproc) install
- name: Build example
working-directory: examples/android/SFML_GRAPHICS
run: ./gradlew assembleDebug -P NDK_VERSION=${ANDROID_NDK_ROOT##*/} -P ARCH_ABI=${ARCH_ABI} --info
#----------------------------------------
ios-sfml-graphics:
runs-on: macos-12
env:
SFML_VERSION: 2.6.x # At least 2.6.2 is required
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_IOS_SFML_${{env.SFML_VERSION}}
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
wget -nv https://github.com/SFML/SFML/archive/refs/heads/${SFML_VERSION}.zip
unzip ${SFML_VERSION}.zip
cmake -GXcode -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DBUILD_SHARED_LIBS=OFF -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S SFML-$SFML_VERSION -B SFML-build
cmake --build SFML-build --config Debug --target install -- CODE_SIGNING_ALLOWED=NO
- name: Build TGUI
run: >
cmake -B TGUI-build
-GXcode
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.4
-DCMAKE_INSTALL_PREFIX=TGUI_INSTALL
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
-DFreeType_LIB="$GITHUB_WORKSPACE/SFML-$SFML_VERSION/extlibs/libs-ios/libfreetype.a"
cmake --build TGUI-build --config Debug --target install
#----------------------------------------
ios-sdl:
runs-on: macos-14
env:
SDL_VERSION: 2.26.5
SDL_TTF_VERSION: 2.0.18
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Build SDL
run: |
wget -nv https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.zip
unzip SDL2-$SDL_VERSION.zip
xcodebuild -project SDL2-$SDL_VERSION/Xcode/SDL/SDL.xcodeproj -scheme "Static Library-iOS" CONFIGURATION_BUILD_DIR="$GITHUB_WORKSPACE/SDL-iOS-libs"
- name: Build SDL_ttf
run: |
wget -nv https://github.com/libsdl-org/SDL_ttf/releases/download/release-$SDL_TTF_VERSION/SDL2_ttf-$SDL_TTF_VERSION.zip
unzip SDL2_ttf-$SDL_TTF_VERSION.zip
xcodebuild -project SDL2_ttf-$SDL_TTF_VERSION/Xcode/SDL_ttf.xcodeproj -scheme "Static Library" CONFIGURATION_BUILD_DIR="$GITHUB_WORKSPACE/SDL-iOS-libs"
- name: Build TGUI (SDL_RENDERER)
run: >
cmake -B TGUI-build-iOS-SDL_RENDERER
-GXcode
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0
-DCMAKE_INSTALL_PREFIX=TGUI_INSTALL_SDL_RENDERER
-DTGUI_BACKEND=SDL_RENDERER
-DTGUI_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DSDL2_LIBRARY="$GITHUB_WORKSPACE/SDL-iOS-libs/libSDL2.a"
-DSDL2_INCLUDE_DIR="$GITHUB_WORKSPACE/SDL2-$SDL_VERSION/include"
-DSDL2_TTF_LIBRARY="$GITHUB_WORKSPACE/SDL-iOS-libs/libSDL2_ttf.a"
-DSDL2_TTF_INCLUDE_DIR="$GITHUB_WORKSPACE/SDL2_ttf-$SDL_TTF_VERSION"
-DTGUI_SKIP_SDL_CONFIG=TRUE
cmake --build TGUI-build-iOS-SDL_RENDERER --config Release --target install
test -e TGUI_INSTALL_SDL_RENDERER/lib/libtgui-s.a
- name: Build TGUI (SDL_TTF_GLES2)
run: >
cmake -B TGUI-build-iOS-SDL_TTF_GLES2
-GXcode
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=13.0
-DCMAKE_INSTALL_PREFIX=TGUI_INSTALL_SDL_TTF_GLES2
-DTGUI_BACKEND=SDL_TTF_GLES2
-DTGUI_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DSDL2_LIBRARY="$GITHUB_WORKSPACE/SDL-iOS-libs/libSDL2.a"
-DSDL2_INCLUDE_DIR="$GITHUB_WORKSPACE/SDL2-$SDL_VERSION/include"
-DSDL2_TTF_LIBRARY="$GITHUB_WORKSPACE/SDL-iOS-libs/libSDL2_ttf.a"
-DSDL2_TTF_INCLUDE_DIR="$GITHUB_WORKSPACE/SDL2_ttf-$SDL_TTF_VERSION"
-DTGUI_SKIP_SDL_CONFIG=TRUE
cmake --build TGUI-build-iOS-SDL_TTF_GLES2 --config Release --target install
test -e TGUI_INSTALL_SDL_TTF_GLES2/lib/libtgui-s.a
#----------------------------------------
# TODO: How to put this in a separate workflow file?
# The idea was to have the following at the top:
# on:
# workflow_run:
# workflows: ["CI"]
# branches: ["1.x"]
# types:
# - completed
# and adding the following to the job:
# if: github.event.workflow_run.conclusion == 'success'
#
# But considering this CI workflow is also triggered by pull requests, I would need
# some way to only let the nightly build run if this CI workflow was triggered by a push.
# Since I can't find a way to do that, and workflow_dispatch requires a new job anyway,
# I've decided to just put the nightly build code in this file as well.
nightly-build-windows-visual-studio:
if: github.event_name == 'push' && github.ref == 'refs/heads/1.x'
needs: [linux, linux-latest-dev, linux-oldest, linux-per-backend, windows, windows-oldest, windows-clang, windows-static-mt, macos, android-sdl, android-sfml-graphics, ios-sfml-graphics, ios-sdl]
runs-on: windows-2019
env:
SFML_VERSION: 2.6.1
MSVC_TOOLSET_VERSION: 141 # VS2017
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
with:
path: TGUI
- name: Install dependencies
run: |
Install-ChocoPackage doxygen.install
mkdir x86
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/releases/download/${env:SFML_VERSION}/SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip
7z x SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip -o"x86"
mkdir x64
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/releases/download/${env:SFML_VERSION}/SFML-${env:SFML_VERSION}-windows-vc15-64-bit.zip
7z x SFML-${env:SFML_VERSION}-windows-vc15-64-bit.zip -o"x64"
- name: Remove .git folder
run:
if (Test-Path -Path "TGUI\.git") { Remove-Item "TGUI\.git" -Recurse -Force -Confirm:$false }
- name: Build TGUI (SFML_GRAPHICS, static, x86)
run: >
cmake -S TGUI -B TGUI-build-static-x86
-T v${env:MSVC_TOOLSET_VERSION} -A Win32
-DSFML_DIR="${env:GITHUB_WORKSPACE}/x86/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_DOC=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-static-x86 --config Debug
cmake --build TGUI-build-static-x86 --config Release
- name: Build TGUI (SFML_GRAPHICS, static, x64)
run: >
cmake -S TGUI -B TGUI-build-static-x64
-T v${env:MSVC_TOOLSET_VERSION} -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/x64/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_DOC=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-static-x64 --config Debug
cmake --build TGUI-build-static-x64 --config Release
- name: Build TGUI (SFML_GRAPHICS, dynamic, x86)
run: >
cmake -S TGUI -B TGUI-build-dynamic-x86
-T v${env:MSVC_TOOLSET_VERSION} -A Win32
-DSFML_DIR="${env:GITHUB_WORKSPACE}/x86/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-dynamic-x86 --config Debug
cmake --build TGUI-build-dynamic-x86 --config Release
- name: Build TGUI (SFML_GRAPHICS, dynamic, x64)
run: >
cmake -S TGUI -B TGUI-build-dynamic-x64
-T v${env:MSVC_TOOLSET_VERSION} -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/x64/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-dynamic-x64 --config Debug
cmake --build TGUI-build-dynamic-x64 --config Release
- name: Create package (SFML_GRAPHICS, x86)
run: |
echo d | xcopy /s TGUI TGUI-1.x-nightly
mkdir TGUI-1.x-nightly\lib
mkdir TGUI-1.x-nightly\bin
move TGUI-build-static-x86\lib\Release\tgui-s.lib TGUI-1.x-nightly\lib\
move TGUI-build-static-x86\lib\Debug\tgui-s-d.lib TGUI-1.x-nightly\lib\
move TGUI-build-static-x86\lib\Debug\tgui-s-d.pdb TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x86\lib\Release\tgui.lib TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x86\lib\Release\tgui.dll TGUI-1.x-nightly\bin\
move TGUI-build-dynamic-x86\lib\Debug\tgui-d.lib TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x86\lib\Debug\tgui-d.dll TGUI-1.x-nightly\bin\
move TGUI-build-dynamic-x86\lib\Debug\tgui-d.pdb TGUI-1.x-nightly\lib\
move TGUI-build-static-x86\doc\html TGUI-1.x-nightly\doc\
7z a -tzip TGUI-1.x-nightly-VisualStudio-32bit-for-SFML-${env:SFML_VERSION}.zip TGUI-1.x-nightly
Remove-Item TGUI-1.x-nightly -Recurse -Force -Confirm:$false
- name: Create package (SFML_GRAPHICS, x64)
run: |
echo d | xcopy /s TGUI TGUI-1.x-nightly
mkdir TGUI-1.x-nightly\lib
mkdir TGUI-1.x-nightly\bin
move TGUI-build-static-x64\lib\Release\tgui-s.lib TGUI-1.x-nightly\lib\
move TGUI-build-static-x64\lib\Debug\tgui-s-d.lib TGUI-1.x-nightly\lib\
move TGUI-build-static-x64\lib\Debug\tgui-s-d.pdb TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x64\lib\Release\tgui.lib TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x64\lib\Release\tgui.dll TGUI-1.x-nightly\bin\
move TGUI-build-dynamic-x64\lib\Debug\tgui-d.lib TGUI-1.x-nightly\lib\
move TGUI-build-dynamic-x64\lib\Debug\tgui-d.dll TGUI-1.x-nightly\bin\
move TGUI-build-dynamic-x64\lib\Debug\tgui-d.pdb TGUI-1.x-nightly\lib\
move TGUI-build-static-x64\doc\html TGUI-1.x-nightly\doc\
7z a -tzip TGUI-1.x-nightly-VisualStudio-64bit-for-SFML-${env:SFML_VERSION}.zip TGUI-1.x-nightly
Remove-Item TGUI-1.x-nightly -Recurse -Force -Confirm:$false
- name: Publish
uses: "crowbarmaster/GH-Automatic-Releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly_build"
prerelease: true
title: "Nightly build"
files: |
TGUI-1.x-nightly-*.zip