From b8f4ac386464c0d2418d3093e7c5f6bc486d2df1 Mon Sep 17 00:00:00 2001 From: Bruno Alexandre Rosa <1791393+brunoalr@users.noreply.github.com> Date: Sat, 3 May 2025 02:20:05 -0300 Subject: [PATCH] ci: use Ninja on linux and macos --- .ci/Arch/Dockerfile | 1 + .ci/Debian11/Dockerfile | 1 + .ci/Debian12/Dockerfile | 5 +++-- .ci/Fedora41/Dockerfile | 1 + .ci/Fedora42/Dockerfile | 1 + .ci/Ubuntu22.04/Dockerfile | 1 + .ci/Ubuntu24.04/Dockerfile | 5 +++-- .ci/docker.sh | 1 + .github/workflows/desktop-build.yml | 7 ++++++- 9 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.ci/Arch/Dockerfile b/.ci/Arch/Dockerfile index ed46e08a9..36cf5c4ae 100644 --- a/.ci/Arch/Dockerfile +++ b/.ci/Arch/Dockerfile @@ -7,6 +7,7 @@ RUN pacman --sync --refresh --sysupgrade --needed --noconfirm \ git \ gtest \ mariadb-libs \ + ninja \ protobuf \ qt6-base \ qt6-imageformats \ diff --git a/.ci/Debian11/Dockerfile b/.ci/Debian11/Dockerfile index 8c4fbe724..b994863bf 100644 --- a/.ci/Debian11/Dockerfile +++ b/.ci/Debian11/Dockerfile @@ -16,6 +16,7 @@ RUN apt-get update && \ libqt5sql5-mysql \ libqt5svg5-dev \ libqt5websockets5-dev \ + ninja-build \ protobuf-compiler \ qt5-image-formats-plugins \ qtmultimedia5-dev \ diff --git a/.ci/Debian12/Dockerfile b/.ci/Debian12/Dockerfile index 21c4ffa29..202405b84 100644 --- a/.ci/Debian12/Dockerfile +++ b/.ci/Debian12/Dockerfile @@ -15,13 +15,14 @@ RUN apt-get update && \ libprotobuf-dev \ libqt6multimedia6 \ libqt6sql6-mysql \ - qt6-svg-dev \ - qt6-websockets-dev \ + ninja-build \ protobuf-compiler \ qt6-image-formats-plugins \ qt6-l10n-tools \ qt6-multimedia-dev \ + qt6-svg-dev \ qt6-tools-dev \ qt6-tools-dev-tools \ + qt6-websockets-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/.ci/Fedora41/Dockerfile b/.ci/Fedora41/Dockerfile index ab23a6052..fc9e86c2e 100644 --- a/.ci/Fedora41/Dockerfile +++ b/.ci/Fedora41/Dockerfile @@ -6,6 +6,7 @@ RUN dnf install -y \ gcc-c++ \ git \ mariadb-devel \ + ninja-build \ protobuf-devel \ qt6-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \ qt6-qtimageformats \ diff --git a/.ci/Fedora42/Dockerfile b/.ci/Fedora42/Dockerfile index cf56ff604..ee4a856f2 100644 --- a/.ci/Fedora42/Dockerfile +++ b/.ci/Fedora42/Dockerfile @@ -6,6 +6,7 @@ RUN dnf install -y \ gcc-c++ \ git \ mariadb-devel \ + ninja-build \ protobuf-devel \ qt6-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \ qt6-qtimageformats \ diff --git a/.ci/Ubuntu22.04/Dockerfile b/.ci/Ubuntu22.04/Dockerfile index 260f449cb..ff2e6e43b 100644 --- a/.ci/Ubuntu22.04/Dockerfile +++ b/.ci/Ubuntu22.04/Dockerfile @@ -17,6 +17,7 @@ RUN apt-get update && \ libqt6sql6-mysql \ libqt6svg6-dev \ libqt6websockets6-dev \ + ninja-build \ protobuf-compiler \ qt6-image-formats-plugins \ qt6-l10n-tools \ diff --git a/.ci/Ubuntu24.04/Dockerfile b/.ci/Ubuntu24.04/Dockerfile index d203690e1..809b2e43a 100644 --- a/.ci/Ubuntu24.04/Dockerfile +++ b/.ci/Ubuntu24.04/Dockerfile @@ -15,13 +15,14 @@ RUN apt-get update && \ libprotobuf-dev \ libqt6multimedia6 \ libqt6sql6-mysql \ - qt6-svg-dev \ - qt6-websockets-dev \ + ninja-build \ protobuf-compiler \ qt6-image-formats-plugins \ qt6-l10n-tools \ qt6-multimedia-dev \ + qt6-svg-dev \ qt6-tools-dev \ qt6-tools-dev-tools \ + qt6-websockets-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/.ci/docker.sh b/.ci/docker.sh index c6ec1b774..e6a900cb5 100644 --- a/.ci/docker.sh +++ b/.ci/docker.sh @@ -147,6 +147,7 @@ function RUN () if [[ $CCACHE_DIR ]]; then args+=(--mount "type=bind,source=$CCACHE_DIR,target=/.ccache") args+=(--env "CCACHE_DIR=/.ccache") + args+=(--env "CMAKE_GENERATOR="Ninja"") fi docker run "${args[@]}" $RUN_ARGS "$IMAGE_NAME" bash "$BUILD_SCRIPT" $RUN_OPTS "$@" return $? diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 7d7652141..ea0be461c 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -129,6 +129,7 @@ jobs: # Cache size over the entire repo is 10Gi: # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy CCACHE_SIZE: 500M + CMAKE_GENERATOR: 'Ninja' steps: - name: Checkout @@ -156,6 +157,8 @@ jobs: - name: Build debug and test if: matrix.test != 'skip' shell: bash + env: + CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' run: | source .ci/docker.sh RUN --server --debug --test --ccache "$CCACHE_SIZE" --parallel 4 @@ -168,6 +171,7 @@ jobs: BUILD_DIR: build SUFFIX: '-${{matrix.distro}}${{matrix.version}}' type: '${{matrix.package}}' + CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' run: | source .ci/docker.sh RUN --server --release --package "$type" --dir "$BUILD_DIR" \ @@ -235,6 +239,7 @@ jobs: env: DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer + CMAKE_GENERATOR: 'Ninja' steps: - name: Checkout @@ -262,6 +267,7 @@ jobs: MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} + CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' # macOS runner have 3 cores usually - only the macos-13 image has 4: # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories # https://github.com/actions/runner-images?tab=readme-ov-file#available-images @@ -394,7 +400,6 @@ jobs: env: PACKAGE_SUFFIX: '-Win${{matrix.target}}' CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' - CMAKE_GENERATOR_PLATFORM: 'x64' QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}' VCPKG_DISABLE_METRICS: 1 VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'