[ci] Route MinGW cross-compilation through ccache

Meson does not automatically prepend ccache to compilers selected in a
cross file. Generate a CI-only overlay with explicit compiler wrappers
and isolate the cache by target architecture. Keep the regular cross
files usable without ccache installed.

Validation: actionlint; C/C++ Meson cross-builds for i686 and x86_64,
including cache hits on rebuild; meson test -C build
(302 passed, one skipped).

Assisted-by: OpenAI Codex
This commit is contained in:
Behdad Esfahbod committed 2026-11-11 17:56:44 -06:00
1 parent 6520c76a16
commit 920baf5d1b
1 file changed
+12 -1
+12 -1
View File
@@ -20,9 +20,11 @@ jobs:
include:
- name: win32
ARCH: 32
TRIPLET: i686-w64-mingw32
PACKAGES: g++-mingw-w64-i686 wine wine32
- name: win64
ARCH: 64
TRIPLET: x86_64-w64-mingw32
PACKAGES: g++-mingw-w64-x86-64 wine wine64 wine32:i386
steps:
@@ -30,6 +32,8 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
with:
key: ${{ github.workflow }}-${{ runner.os }}-${{ matrix.ARCH }}
- name: Install Dependencies
run: |
sudo dpkg --add-architecture i386
@@ -46,7 +50,14 @@ jobs:
- name: Install Python Dependencies
run: pip3 install -r .ci/requirements.txt --require-hashes
- name: Build
run: bash .ci/build-win.sh ${{ matrix.ARCH }}
run: |
cat > "$RUNNER_TEMP/ccache-cross-file.txt" <<'EOF'
[binaries]
c = ['ccache', '${{ matrix.TRIPLET }}-gcc']
cpp = ['ccache', '${{ matrix.TRIPLET }}-g++']
EOF
bash .ci/build-win.sh ${{ matrix.ARCH }} \
--cross-file="$RUNNER_TEMP/ccache-cross-file.txt"
- name: Test
run: meson devenv -Cbuild-win${{ matrix.ARCH }} meson test -t 10 --print-errorlogs --suite=harfbuzz
- name: Archive artifacts