cache thin qt

This commit is contained in:
Bruno Alexandre Rosa 2025-11-06 12:36:14 -03:00
parent 08e4e7815a
commit 788fd03363

View file

@ -278,7 +278,7 @@ jobs:
continue-on-error: ${{matrix.allow-failure == 'yes'}}
env:
# Common parameters for all macOS builds
QT_VERSION: 6.6.*
QT_VERSION: 6.6.3
QT_ARCH: clang_64
QT_MODULES: "qtimageformats qtmultimedia qtwebsockets"
# Build-specific environment variables
@ -303,17 +303,29 @@ jobs:
ccache-key-prefix: ccache-${{matrix.os}}-${{matrix.soc}}-${{matrix.type}}
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add RUNNER_WORKSPACE to GitHub environment variables
run: echo "RUNNER_WORKSPACE=$RUNNER_WORKSPACE" >> $GITHUB_ENV
- name: Restore thin Qt libraries
id: restore_qt
uses: actions/cache/restore@v4
with:
path: ${{ env.RUNNER_WORKSPACE }}/Qt
key: qt-macos-${{ matrix.soc }}-${{ env.QT_VERSION }}
# Using jurplel/install-qt-action to install Qt without using brew
# qt build using vcpkg either just fails or takes too long to build
- name: Install Qt ${{env.QT_VERSION}}
if: steps.restore_qt.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v4
with:
cache: true # qt caches take too much space for macOS (1.1Gi)
cache: false # caching manually after thinning
version: ${{env.QT_VERSION}}
arch: ${{env.QT_ARCH}}
modules: ${{env.QT_MODULES}}
- name: Thin Qt libraries
if: steps.restore_qt.outputs.cache-hit != 'true'
run: |
export ARCH=$(uname -m)
export NPROC=$(sysctl -n hw.ncpu)
@ -322,6 +334,13 @@ jobs:
xargs -0 -n1 -P "$NPROC" sh -c \
'file -b --mime-type "$0" | grep -q "application/x-mach-binary" && lipo "$0" -thin "$ARCH" -output "$0" || true'
- name: Cache thin Qt libraries
if: steps.restore_qt.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.RUNNER_WORKSPACE }}/Qt
key: qt-macos-${{ matrix.soc }}-${{ env.QT_VERSION }}
- name: Setup vcpkg cache
id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
@ -343,6 +362,7 @@ jobs:
VCPKG_DISABLE_METRICS: 1
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
QTDIR: ${{ env.RUNNER_WORKSPACE }}/Qt/${{ env.QT_VERSION }}/macos
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" --vcpkg
- name: Sign app bundle