name: CI on: [push, pull_request, workflow_dispatch] permissions: {} concurrency: group: environment-${{github.ref}} cancel-in-progress: true env: SFML_VERSION: 3.0.2 defaults: run: shell: bash jobs: build: name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }} runs-on: ${{ matrix.platform.os }} strategy: fail-fast: false matrix: platform: - { name: Windows VS2026 x86, os: windows-2025-vs2026, flags: -AWin32 } - { name: Windows VS2026 x64, os: windows-2025-vs2026, flags: -Ax64 } # ClangCL is disabled until we build against SFML 3.1, the FLAC version bundled with SFML 3.0 fails to compile with VS2026's ClangCL # - { name: Windows ClangCL, os: windows-2025-vs2026, flags: -T ClangCL } - { name: Windows Clang, os: windows-2025-vs2026, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } - { name: Linux GCC, os: ubuntu-24.04, flags: -GNinja } - { name: Linux Clang, os: ubuntu-24.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } - { name: MacOS, os: macos-15, flags: -GNinja } config: - { name: Shared, flags: -DBUILD_SHARED_LIBS=ON, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=OFF } - { name: Static, flags: -DBUILD_SHARED_LIBS=OFF, csfml_flags: -DCSFML_LINK_SFML_STATICALLY=ON } type: - { name: Debug } - { name: Release } steps: - name: Get CMake and Ninja uses: lukka/get-cmake@latest with: cmakeVersion: ${{ runner.os == 'Windows' && '4.2' || '3.22' }} # Visual Studio 2026 generator requires CMake 4.2 or later ninjaVersion: latest - name: Install Linux Dependencies if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype-dev - name: Checkout SFML uses: actions/checkout@v7 with: persist-credentials: false repository: SFML/SFML ref: ${{env.SFML_VERSION}} path: SFML - name: Configure SFML CMake env: BUILD_TYPE: ${{ matrix.type.name }} CMAKE_FLAGS: ${{ matrix.platform.flags }} ${{ matrix.config.flags }} run: | cmake -S SFML -B SFML/build \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ -DCMAKE_INSTALL_PREFIX=SFML/install \ $CMAKE_FLAGS - name: Build SFML env: BUILD_TYPE: ${{ matrix.type.name }} run: cmake --build SFML/build --config "$BUILD_TYPE" --target install - name: Checkout CSFML uses: actions/checkout@v7 with: persist-credentials: false path: CSFML - name: Configure CSFML CMake env: BUILD_TYPE: ${{ matrix.type.name }} CMAKE_FLAGS: ${{ matrix.platform.flags }} ${{ matrix.config.flags }} ${{ matrix.config.csfml_flags }} run: | cmake --preset dev -S CSFML -B CSFML/build \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ -DCMAKE_INSTALL_PREFIX=CSFML/install \ -DSFML_ROOT=SFML/install \ -DCMAKE_VERBOSE_MAKEFILE=ON \ $CMAKE_FLAGS - name: Build CSFML env: BUILD_TYPE: ${{ matrix.type.name }} run: cmake --build CSFML/build --config "$BUILD_TYPE" --target install - name: Test env: BUILD_TYPE: ${{ matrix.type.name }} run: ctest --test-dir CSFML/build -C "$BUILD_TYPE" --output-on-failure format: name: Formatting runs-on: ubuntu-24.04 steps: - name: Install Clang Format run: sudo apt-get install clang-format-17 - name: Checkout Code uses: actions/checkout@v7 with: persist-credentials: false - name: Format Code run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-17 -P cmake/Format.cmake - name: Check Formatting run: git diff --exit-code tidy: name: Analyze runs-on: macos-15 steps: - name: Get CMake and Ninja uses: lukka/get-cmake@latest with: cmakeVersion: ${{ runner.os == 'Windows' && '4.2' || '3.22' }} # Visual Studio 2026 generator requires CMake 4.2 or later ninjaVersion: latest - name: Install Dependencies run: | brew update brew install llvm@18 ninja echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH - name: Checkout SFML uses: actions/checkout@v7 with: persist-credentials: false repository: SFML/SFML ref: ${{env.SFML_VERSION}} path: SFML - name: Configure SFML CMake run: cmake -S SFML -B SFML/build -GNinja -DCMAKE_INSTALL_PREFIX=SFML/install -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug - name: Build SFML run: cmake --build SFML/build --target install - name: Checkout CSFML uses: actions/checkout@v7 with: persist-credentials: false path: CSFML - name: Configure CSFML CMake run: cmake --preset dev -S CSFML -B CSFML/build -DSFML_ROOT=SFML/install -DCMAKE_BUILD_TYPE=Debug - name: Tidy run: cmake --build CSFML/build --target tidy docs: name: Documentation runs-on: macos-15 steps: - name: Get CMake and Ninja uses: lukka/get-cmake@latest with: cmakeVersion: ${{ runner.os == 'Windows' && '4.2' || '3.22' }} # Visual Studio 2026 generator requires CMake 4.2 or later ninjaVersion: latest - name: Install Doxygen run: | brew update brew install doxygen ninja || true - name: Checkout SFML uses: actions/checkout@v7 with: persist-credentials: false repository: SFML/SFML ref: ${{env.SFML_VERSION}} path: SFML - name: Configure SFML run: cmake -S SFML -B SFML/build -GNinja -DCMAKE_INSTALL_PREFIX=SFML/install - name: Build SFML run: cmake --build SFML/build --target install - name: Checkout CSFML uses: actions/checkout@v7 with: persist-credentials: false path: CSFML - name: Configure CSFML run: cmake -S CSFML -B CSFML/build -GNinja -DSFML_ROOT=SFML/install -DCSFML_BUILD_DOC=ON -DCSFML_LINK_SFML_STATICALLY=ON - name: Build Doxygen Site run: cmake --build CSFML/build --target doc