Ignore clang's compile commands symlink #1572
Workflow file for this run
This file contains hidden or 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 | |
| # This workflow will work for pushes, pull requests, or a manual trigger (workflow_dispatch). | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| build: | |
| name: "${{ matrix.os }} / ${{ matrix.compiler }} / ${{ matrix.runtime_shader_compilation == 'ON' && 'runtime-shaders' || 'precompiled-shaders' }} / ${{ matrix.framework_static == 'ON' && 'static' || 'shared' }}" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| # Don't cancel other in-progress jobs if one fails. | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-2025-vs2026] | |
| compiler: [gcc, clang, msvc] | |
| runtime_shader_compilation: [ON, OFF] | |
| framework_static: [ON, OFF] | |
| exclude: | |
| # msvc is only available on Windows | |
| - os: ubuntu-latest | |
| compiler: msvc | |
| - os: macos-latest | |
| compiler: msvc | |
| # gcc on Windows would require MinGW — excluded for simplicity | |
| - os: windows-2025-vs2026 | |
| compiler: gcc | |
| # framework_static OFF only for specific combos | |
| - os: ubuntu-latest | |
| compiler: clang | |
| framework_static: OFF | |
| - os: macos-latest | |
| compiler: gcc | |
| framework_static: OFF | |
| steps: | |
| # Linux needs to install various dependencies. | |
| - name: Install Linux Dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends build-essential git make \ | |
| pkg-config gnome-desktop-testing \ | |
| libaudio-dev libfribidi-dev \ | |
| libxkbcommon-dev libgl1-mesa-dev libgles2-mesa-dev \ | |
| libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev \ | |
| liburing-dev | |
| if: runner.os == 'Linux' | |
| - uses: actions/checkout@master | |
| - uses: ./.github/actions/setup-cmake | |
| - name: Setup CCache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ runner.os }}-${{matrix.compiler}}-${{ matrix.runtime_shader_compilation }}-${{ matrix.framework_static }} | |
| - name: Set up MSVC developer environment | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| if: matrix.compiler == 'msvc' | |
| - name: Set compiler environment | |
| shell: bash | |
| run: | | |
| case "${{ matrix.compiler }}" in | |
| gcc) | |
| echo "CC=gcc" >> "$GITHUB_ENV" | |
| echo "CXX=g++" >> "$GITHUB_ENV" | |
| ;; | |
| clang) | |
| echo "CC=clang" >> "$GITHUB_ENV" | |
| echo "CXX=clang++" >> "$GITHUB_ENV" | |
| ;; | |
| msvc) | |
| echo "CC=cl" >> "$GITHUB_ENV" | |
| echo "CXX=cl" >> "$GITHUB_ENV" | |
| ;; | |
| esac | |
| - name: Configure | |
| shell: bash | |
| run: > | |
| cmake -B build -G Ninja | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded | |
| -DCMAKE_POLICY_CMP0141=NEW | |
| -DSDL_ALSA=OFF | |
| -DSDL_CCACHE=ON | |
| -DSDL_JACK=OFF | |
| -DSDL_KMSDRM=OFF | |
| -DSDL_OPENGL=OFF | |
| -DSDL_OPENGLES=OFF | |
| -DSDL_PIPEWIRE=OFF | |
| -DSDL_PULSEAUDIO=OFF | |
| -DSDL_RENDER=OFF | |
| -DSDL_SNDIO=OFF | |
| -DSDL_UNIX_CONSOLE_BUILD=ON | |
| -DSDL_WAYLAND=OFF | |
| -DSDL_X11=OFF | |
| -DCF_RUNTIME_SHADER_COMPILATION=${{ matrix.runtime_shader_compilation }} | |
| -DCF_FRAMEWORK_STATIC=${{ matrix.framework_static }} | |
| - name: Build | |
| run: cmake --build build | |
| - name: Tests | |
| run: ./build/tests | |
| - name: Generate artifacts for Windows | |
| shell: cmd | |
| run: | | |
| robocopy include dist *.h | |
| if %errorlevel% geq 8 exit /b 1 | |
| robocopy build\lib dist cute*.lib | |
| if %errorlevel% geq 8 exit /b 1 | |
| 7z a artifact.zip .\dist\* | |
| if: runner.os == 'Windows' | |
| - name: Generate artifacts for MacOS | |
| run: | | |
| mkdir -p ./dist | |
| cp -v ./include/*.h ./dist | |
| cp -R -v ./build/lib/libcute*.a ./dist | |
| tar -czvf artifact.tar.gz -C dist . | |
| if: runner.os == 'macOS' | |
| - name: Generate artifacts for Linux | |
| run: | | |
| mkdir -p ./dist | |
| cp -v ./include/*.h ./dist | |
| cp -v ./build/lib/libcute*.a ./dist | |
| tar -czvf artifact.tar.gz -C dist . | |
| if: runner.os == 'Linux' | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.compiler }}-shader-${{ matrix.runtime_shader_compilation == 'ON' && 'runtime-shaders' || 'precompiled-shaders' }}-${{ matrix.framework_static == 'ON' && 'static' || 'shared' }} | |
| if-no-files-found: error | |
| path: | | |
| artifact.zip | |
| artifact.tar.gz | |
| emscripten: | |
| name: "emscripten / emcc / precompiled-shaders / static" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: ./.github/actions/setup-cmake | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: latest | |
| actions-cache-folder: "emsdk-cache" | |
| - name: Setup CCache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: emscripten | |
| - name: Verify Emscripten | |
| run: emcc -v | |
| - name: Configure | |
| run: > | |
| emcmake cmake -B build | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| -DCF_FRAMEWORK_STATIC=ON | |
| - name: Build | |
| run: cmake --build build |