From 41d2bd6d91bc2daeaf82f2a0c440c2db6e1cdce8 Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 18 Oct 2026 20:15:24 -0600 Subject: [PATCH] Key wxWidgets cache to source and toolchain inputs --- .gitea/workflows/next.yml | 5 ++++- .gitea/workflows/release.yml | 6 +++++- .gitea/workflows/verify.yml | 6 +++++- ci/wx-cache-key.sh | 21 +++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 ci/wx-cache-key.sh diff --git a/.gitea/workflows/next.yml b/.gitea/workflows/next.yml index 0d664317..e112ce13 100644 --- a/.gitea/workflows/next.yml +++ b/.gitea/workflows/next.yml @@ -26,10 +26,13 @@ jobs: run: | apt-get update -qq apt-get install -y -qq --no-install-recommends libssl-dev pkg-config ca-certificates + - name: Compute wxWidgets cache key + id: wx-key + run: bash ci/wx-cache-key.sh - uses: actions/cache@v4 with: path: /root/.cache/wx-3.3.3-linux - key: wx-3.3.3-${{ runner.os }}-${{ hashFiles('thirdparty/wx-rs/VERSION') }} + key: ${{ steps.wx-key.outputs.key }} - name: Build wxWidgets run: | if [ ! -x "$WX_PREFIX/bin/wx-config" ]; then diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 1fcce6d9..2fdb91d7 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -52,11 +52,15 @@ jobs: libssl-dev pkg-config ca-certificates openssh-client \ xvfb xauth dbus-x11 fonts-dejavu-core >/dev/null + - name: Compute wxWidgets cache key + id: wx-key + run: bash ci/wx-cache-key.sh + - name: Cache vendored wxWidgets build uses: actions/cache@v4 with: path: /root/.cache/wx-3.3.3-linux - key: wx-3.3.3-${{ runner.os }}-${{ hashFiles('thirdparty/wx-rs/VERSION') }} + key: ${{ steps.wx-key.outputs.key }} - name: Build wxWidgets (once, then cached) run: | diff --git a/.gitea/workflows/verify.yml b/.gitea/workflows/verify.yml index 826c8361..81104c0b 100644 --- a/.gitea/workflows/verify.yml +++ b/.gitea/workflows/verify.yml @@ -23,11 +23,15 @@ jobs: apt-get install -y -qq --no-install-recommends \ libssl-dev pkg-config ca-certificates >/dev/null + - name: Compute wxWidgets cache key + id: wx-key + run: bash ci/wx-cache-key.sh + - name: Cache vendored wxWidgets build uses: actions/cache@v4 with: path: /root/.cache/wx-3.3.3-linux - key: wx-3.3.3-${{ runner.os }}-${{ hashFiles('thirdparty/wx-rs/VERSION') }} + key: ${{ steps.wx-key.outputs.key }} - name: Build wxWidgets (once, then cached) run: | diff --git a/ci/wx-cache-key.sh b/ci/wx-cache-key.sh new file mode 100644 index 00000000..65f37d68 --- /dev/null +++ b/ci/wx-cache-key.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MIT +# Key the native wxWidgets prefix to its tracked source and build toolchain. +set -euo pipefail + +material="$({ + git rev-parse HEAD:thirdparty/wxwidgets/wxWidgets-3.3.3 + git rev-parse HEAD:scripts/build-wx-linux.sh + cat thirdparty/wx-rs/VERSION + gcc -dumpmachine + gcc -dumpfullversion + pkg-config --modversion gtk+-3.0 + getconf GNU_LIBC_VERSION +} )" +digest="$(printf '%s\n' "$material" | sha256sum | cut -c1-24)" +key="wx-3.3.3-$digest" +if [ -n "${GITHUB_OUTPUT:-}" ]; then + printf 'key=%s\n' "$key" >> "$GITHUB_OUTPUT" +else + printf '%s\n' "$key" +fi