From c26b05b1dd56ae06785d63777fdcee87c4303349 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 14 Apr 2026 15:04:24 -0600 Subject: [PATCH] Update CI for self-hosted runners --- .github/workflows/build.yml | 67 +++++++++++++++++++------------------ CMakeLists.txt | 10 ++++-- CMakePresets.json | 46 +++++++++++++++---------- ci/build-appimage.sh | 2 +- 4 files changed, 71 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1412aec639..0607841922 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,9 @@ on: pull_request: env: - SCCACHE_GHA_ENABLED: "true" + # SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + SENTRY_DSN: ${{ secrets.SENTRY_DSN }} jobs: build-linux: @@ -21,13 +22,13 @@ jobs: matrix: include: - name: GCC x86_64 - runner: ubuntu-latest + runner: [self-hosted, Linux] preset: gcc artifact_arch: x86_64 - - name: GCC aarch64 - runner: ubuntu-24.04-arm - preset: gcc - artifact_arch: aarch64 + # - name: GCC aarch64 + # runner: ubuntu-24.04-arm + # preset: gcc + # artifact_arch: aarch64 # - name: Clang x86_64 # runner: ubuntu-latest # preset: clang @@ -40,17 +41,22 @@ jobs: submodules: recursive - name: Install dependencies + if: 'false' # disabled for self-hosted run: | sudo apt-get update sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \ zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \ libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \ libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \ - libxss-dev libfuse2 + libxss-dev libfuse2 libusb-1.0-0-dev libdecor-0-dev libpipewire-0.3-dev libunwind-dev - name: Setup sccache + if: 'false' # disabled for self-hosted uses: mozilla-actions/sccache-action@v0.0.9 + - name: Print sccache stats + run: sccache --show-stats + - name: Configure CMake run: cmake --preset x-linux-ci-${{matrix.preset}} @@ -68,9 +74,9 @@ jobs: build/install/Dusk-*.AppImage build/install/debug.tar.* - build-apple: name: Build Apple (${{matrix.name}}) + if: 'false' # TODO enable when CI is free runs-on: macos-latest strategy: fail-fast: false @@ -80,14 +86,14 @@ jobs: platform: macos preset: x-macos-ci artifact_name: macos-appleclang-universal - # - name: AppleClang iOS arm64 # TODO enable when CI is free - # platform: ios - # preset: x-ios-ci - # artifact_name: ios-appleclang-arm64 - # - name: AppleClang tvOS arm64 # TODO enable when CI is free - # platform: tvos - # preset: x-tvos-ci - # artifact_name: tvos-appleclang-arm64 + - name: AppleClang iOS arm64 + platform: ios + preset: x-ios-ci + artifact_name: ios-appleclang-arm64 + - name: AppleClang tvOS arm64 + platform: tvos + preset: x-tvos-ci + artifact_name: tvos-appleclang-arm64 steps: - uses: actions/checkout@v6 @@ -139,26 +145,22 @@ jobs: name: Build Windows (${{matrix.name}}) runs-on: ${{matrix.runner}} - env: - BUILD_DIR: C:\build - SCCACHE_DIR: C:\sccache - strategy: fail-fast: false matrix: include: - name: MSVC x86_64 - runner: windows-latest + runner: [self-hosted, Windows] preset: msvc msvc_arch: amd64 vcpkg_arch: x64 artifact_arch: x86_64 - - name: MSVC arm64 - runner: windows-11-arm - preset: arm64-msvc - msvc_arch: arm64 - vcpkg_arch: arm64 - artifact_arch: arm64 + # - name: MSVC arm64 + # runner: windows-11-arm + # preset: arm64-msvc + # msvc_arch: arm64 + # vcpkg_arch: arm64 + # artifact_arch: arm64 # - name: Clang x86_64 # runner: windows-latest # preset: clang @@ -185,11 +187,10 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.9 - name: Install dependencies + if: 'false' # disabled for self-hosted run: | choco install ninja - vcpkg install zlib:${{matrix.vcpkg_arch}}-windows-static bzip2:${{matrix.vcpkg_arch}}-windows-static ` - zstd:${{matrix.vcpkg_arch}}-windows-static liblzma:${{matrix.vcpkg_arch}}-windows-static ` - freetype:${{matrix.vcpkg_arch}}-windows-static + vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static - name: Configure CMake run: cmake --preset x-windows-ci-${{matrix.preset}} @@ -202,5 +203,7 @@ jobs: with: name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}} path: | - ${{env.BUILD_DIR}}/install/*.exe - ${{env.BUILD_DIR}}/install/debug.7z + build/install/*.exe + build/install/*.dll + build/install/res/ + build/install/debug.7z diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ca90b3e5d..25d5d386f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN") set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment") if (DUSK_MOVIE_SUPPORT) - find_package(libjpeg-turbo QUIET) + find_package(libjpeg-turbo 3.0 CONFIG QUIET) if (libjpeg-turbo_FOUND) message(STATUS "dusk: Using system libjpeg-turbo") else () @@ -297,8 +297,12 @@ endif () # Edit & Continue if (MSVC) - add_compile_options("/ZI") - add_link_options("/INCREMENTAL") + if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue") + endif () + if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue") + add_link_options("/INCREMENTAL") + endif () endif () if(ANDROID) diff --git a/CMakePresets.json b/CMakePresets.json index c3c7463be3..44e75973b9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -22,6 +22,20 @@ "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded" } }, + { + "name": "ci", + "hidden": true, + "cacheVariables": { + "CMAKE_C_COMPILER_LAUNCHER": "sccache", + "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", + "DUSK_ENABLE_SENTRY_NATIVE": { + "type": "BOOL", + "value": true + }, + "DUSK_SENTRY_DSN": "$env{SENTRY_DSN}", + "DUSK_SENTRY_ENVIRONMENT": "production" + } + }, { "name": "linux-default", "displayName": "Linux (default)", @@ -343,12 +357,9 @@ "name": "x-linux-ci", "hidden": true, "inherits": [ - "relwithdebinfo" - ], - "cacheVariables": { - "CMAKE_C_COMPILER_LAUNCHER": "sccache", - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache" - } + "relwithdebinfo", + "ci" + ] }, { "name": "x-linux-ci-gcc", @@ -367,12 +378,9 @@ { "name": "x-macos-ci", "inherits": [ - "macos-default-relwithdebinfo" - ], - "cacheVariables": { - "CMAKE_C_COMPILER_LAUNCHER": "sccache", - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache" - } + "macos-default-relwithdebinfo", + "ci" + ] }, { "name": "x-ios-ci", @@ -398,14 +406,16 @@ "name": "x-windows-ci", "hidden": true, "inherits": [ - "relwithdebinfo" + "relwithdebinfo", + "ci" ], - "binaryDir": "$env{BUILD_DIR}", "cacheVariables": { - "CMAKE_INSTALL_PREFIX": "$env{BUILD_DIR}/install", - "CMAKE_C_COMPILER_LAUNCHER": "sccache", - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", - "CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded" + "CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded", + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + }, + "VCPKG_TARGET_TRIPLET": "x64-windows" } }, { diff --git a/ci/build-appimage.sh b/ci/build-appimage.sh index 82c4cffaeb..3ce3021b97 100755 --- a/ci/build-appimage.sh +++ b/ci/build-appimage.sh @@ -9,7 +9,7 @@ chmod +x linuxdeploy-$(uname -m).AppImage # Build AppImage cd "$GITHUB_WORKSPACE" mkdir -p build/appdir/usr/{bin,share/{applications,icons/hicolor}} -cp build/install/!(*.*) build/appdir/usr/bin +cp -r build/install/!(*.*) build/appdir/usr/bin cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor cp platforms/freedesktop/dusk.desktop build/appdir/usr/share/applications