Add custom software cursor #32
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 on Linux | |
| on: [push, pull_request] | |
| env: | |
| BUILD_TYPE: Release | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.name }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu | |
| compiler: gcc | |
| backend: Cairo | |
| precompile_headers: "ON" | |
| name: "Ubuntu GCC with PCH" | |
| - os: ubuntu | |
| compiler: gcc | |
| backend: Cairo | |
| precompile_headers: "OFF" | |
| name: "Ubuntu GCC without PCH" | |
| - os: archlinux | |
| compiler: gcc | |
| backend: Cairo | |
| precompile_headers: "ON" | |
| name: "Arch Linux GCC Cairo with PCH" | |
| - os: archlinux | |
| compiler: gcc | |
| backend: Cairo | |
| precompile_headers: "OFF" | |
| name: "Arch Linux GCC Cairo without PCH" | |
| - os: archlinux | |
| compiler: gcc | |
| backend: Skia | |
| precompile_headers: "ON" | |
| name: "Arch Linux GCC Skia with PCH" | |
| - os: archlinux | |
| compiler: gcc | |
| backend: Skia | |
| precompile_headers: "OFF" | |
| name: "Arch Linux GCC Skia without PCH" | |
| steps: | |
| - name: '🧰 Checkout' | |
| uses: actions/checkout@v6 | |
| - name: '🔎 Detect compiled-file changes' | |
| id: changes | |
| uses: dorny/paths-filter@v4 | |
| with: | |
| filters: | | |
| compiled: | |
| - 'CMakeLists.txt' | |
| - 'cmake/**' | |
| - 'vcpkg.json' | |
| - 'vcpkg-configuration.json' | |
| - 'core/**' | |
| - 'include/**' | |
| - 'tests/**' | |
| - 'demos/**' | |
| - 'css/**' | |
| - '**/*.c' | |
| - '**/*.cc' | |
| - '**/*.cpp' | |
| - '**/*.cxx' | |
| - '**/*.h' | |
| - '**/*.hpp' | |
| - '**/*.cu' | |
| - name: '🔁 Check previous run for this job' | |
| id: last | |
| uses: actions/github-script@v8 | |
| env: | |
| JOB_NAME: '${{ matrix.name }}' | |
| with: | |
| script: | | |
| if (context.eventName !== 'push') { | |
| core.setOutput('force', 'false'); | |
| return; | |
| } | |
| const jobName = process.env.JOB_NAME; | |
| const branch = context.ref.replace('refs/heads/', ''); | |
| const runs = await github.paginate( | |
| github.rest.actions.listWorkflowRunsForRepo, | |
| { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| branch, | |
| status: 'completed', | |
| per_page: 50, | |
| } | |
| ); | |
| const priorRuns = runs | |
| .filter(r => r.name === context.workflow && r.id !== context.runId) | |
| .sort((a, b) => new Date(b.created_at) - new Date(a.created_at)); | |
| let force = 'false'; | |
| for (const run of priorRuns) { | |
| const jobs = await github.paginate( | |
| github.rest.actions.listJobsForWorkflowRun, | |
| { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| run_id: run.id, | |
| per_page: 100, | |
| } | |
| ); | |
| const matched = jobs.find(j => j.name === jobName); | |
| if (matched) { | |
| core.info( | |
| `Last "${jobName}" (run ${run.id}) conclusion: ${matched.conclusion}` | |
| ); | |
| if (matched.conclusion !== 'success') force = 'true'; | |
| break; | |
| } | |
| } | |
| core.setOutput('force', force); | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential software-properties-common gcc g++ sed python3 tar wget cmake autoconf automake libtool curl make unzip zlib1g-dev libpng-dev vim-common git libgtest-dev google-mock libglu1-mesa-dev freeglut3-dev mesa-common-dev libcairo-dev libpango1.0-dev libxml2-dev libjpeg-dev libvulkan-dev vulkan-validationlayers glslang-tools | |
| if: matrix.os == 'ubuntu' && (steps.changes.outputs.compiled == 'true' || steps.last.outputs.force == 'true') | |
| - name: '🛠️ Configuring' | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_DISABLE_PRECOMPILE_HEADERS=${{ matrix.precompile_headers == 'OFF' && 'ON' || 'OFF' }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_HTML=ON | |
| if: matrix.os == 'ubuntu' && (steps.changes.outputs.compiled == 'true' || steps.last.outputs.force == 'true') | |
| - name: '🏗️ Building' | |
| run: cmake --build ${{github.workspace}}/build | |
| if: matrix.os == 'ubuntu' && (steps.changes.outputs.compiled == 'true' || steps.last.outputs.force == 'true') | |
| - name: '🧪 Running Tests' | |
| run: ctest --test-dir ${{github.workspace}}/build --output-on-failure | |
| if: matrix.os == 'ubuntu' && (steps.changes.outputs.compiled == 'true' || steps.last.outputs.force == 'true') | |
| - name: '🐧 Setup and run Arch Linux build' | |
| run: | | |
| docker run --rm -v ${{github.workspace}}:/workspace -w /workspace archlinux:latest bash -euxo pipefail -c " | |
| pacman -Sy --noconfirm archlinux-keyring gnupg && | |
| pacman-key --init && | |
| pacman-key --populate archlinux && | |
| pacman -Syu --noconfirm && | |
| pacman -S --noconfirm base-devel gcc cmake python git gtest mesa glu freeglut vulkan-devel vulkan-validation-layers glslang cairo pango libxml2 libjpeg-turbo libpng zlib pkg-config ttf-dejavu fontconfig && | |
| fc-cache -f && | |
| if [ '${{ matrix.backend }}' = 'Skia' ]; then | |
| pacman -S --noconfirm gn ninja expat freetype2 harfbuzz icu libwebp && | |
| useradd -m builder && | |
| su builder -c 'cd /tmp && git clone --depth 1 https://github.com/AeonGames/ArchRepo.git && cd ArchRepo/skia && makepkg -s --noconfirm' && | |
| pacman -U --noconfirm /tmp/ArchRepo/skia/skia-aeongui-*.pkg.tar.zst | |
| fi && | |
| cmake -B /workspace/build -DAEONGUI_BACKEND=${{ matrix.backend }} -DCMAKE_DISABLE_PRECOMPILE_HEADERS=${{ matrix.precompile_headers == 'OFF' && 'ON' || 'OFF' }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_HTML=ON && | |
| cmake --build /workspace/build && | |
| ctest --test-dir /workspace/build --output-on-failure | |
| " | |
| if: matrix.os == 'archlinux' && (steps.changes.outputs.compiled == 'true' || steps.last.outputs.force == 'true') | |
| - name: '✅ Skip build (no compiled changes)' | |
| if: steps.changes.outputs.compiled != 'true' && steps.last.outputs.force != 'true' | |
| run: echo "No compiled-relevant files changed and previous run succeeded. Skipping build and tests." |