From 671b7beff502519e86f192e859f779da3e889ef6 Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 18 Oct 2026 22:28:35 -0600 Subject: [PATCH] Use prebuilt CI tools and skip redundant wx cache transfer --- .gitea/workflows/ci-badge.yml | 2 +- .gitea/workflows/next.yml | 2 +- .gitea/workflows/release.yml | 17 +++++++---------- .gitea/workflows/source.yml | 2 +- .gitea/workflows/verify.yml | 9 +++++++-- ci/check-wx-image-prefix.sh | 16 ++++++++++++++++ ci/runner-image.txt | 2 +- 7 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 ci/check-wx-image-prefix.sh diff --git a/.gitea/workflows/ci-badge.yml b/.gitea/workflows/ci-badge.yml index 85065fa3..6b8bbcac 100644 --- a/.gitea/workflows/ci-badge.yml +++ b/.gitea/workflows/ci-badge.yml @@ -9,7 +9,7 @@ jobs: publish: runs-on: alkane-fast container: - image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15 permissions: actions: read contents: write diff --git a/.gitea/workflows/next.yml b/.gitea/workflows/next.yml index 3c005692..a1cfa898 100644 --- a/.gitea/workflows/next.yml +++ b/.gitea/workflows/next.yml @@ -15,7 +15,7 @@ jobs: candidate: runs-on: alkane-ci container: - image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15 env: CARGO_TARGET_DIR: target WX_PREFIX: /root/.cache/wx-3.3.3-linux diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 70461e8c..7faa4a7e 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -18,7 +18,7 @@ jobs: release: runs-on: alkane-ci container: - image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15 env: CARGO_TARGET_DIR: target WX_PREFIX: /root/.cache/wx-3.3.3-linux @@ -57,7 +57,12 @@ jobs: id: wx-key run: bash ci/wx-cache-key.sh + - name: Check prebuilt wxWidgets + id: wx-image + run: bash ci/check-wx-image-prefix.sh + - name: Cache vendored wxWidgets build + if: steps.wx-image.outputs.available != 'true' id: wx-cache uses: actions/cache/restore@v4 continue-on-error: true @@ -135,15 +140,7 @@ jobs: run: | set -euo pipefail rustup component add llvm-tools-preview >/dev/null 2>&1 || true - if ! command -v cargo-llvm-cov >/dev/null 2>&1; then - V=0.8.7 - URL="https://github.com/taiki-e/cargo-llvm-cov/releases/download/v${V}/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz" - DEST="${CARGO_HOME:-$HOME/.cargo}/bin" - mkdir -p "$DEST" - curl -fsSL "$URL" | tar -xz -C "$DEST" - export PATH="$DEST:$PATH" - fi - command -v cargo-llvm-cov >/dev/null + [ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ] PCT=$(bash ci/coverage.sh --summary-only \ | awk '/^TOTAL/{gsub(/%/,"",$10); print $10}') [ -n "$PCT" ] || { echo "coverage report produced no TOTAL line" >&2; exit 1; } diff --git a/.gitea/workflows/source.yml b/.gitea/workflows/source.yml index 6cd3af40..42b8cf07 100644 --- a/.gitea/workflows/source.yml +++ b/.gitea/workflows/source.yml @@ -14,7 +14,7 @@ jobs: check: runs-on: alkane-fast container: - image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15 env: CARGO_BUILD_JOBS: 2 steps: diff --git a/.gitea/workflows/verify.yml b/.gitea/workflows/verify.yml index 105095b3..e71c46c9 100644 --- a/.gitea/workflows/verify.yml +++ b/.gitea/workflows/verify.yml @@ -13,7 +13,7 @@ jobs: verify: runs-on: alkane-verify container: - image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15 env: CARGO_TARGET_DIR: target CARGO_BUILD_JOBS: 2 @@ -57,8 +57,13 @@ jobs: if: steps.surface.outputs.surface == 'full' run: bash ci/wx-cache-key.sh - - name: Cache vendored wxWidgets build + - name: Check prebuilt wxWidgets + id: wx-image if: steps.surface.outputs.surface == 'full' + run: bash ci/check-wx-image-prefix.sh + + - name: Cache vendored wxWidgets build + if: steps.surface.outputs.surface == 'full' && steps.wx-image.outputs.available != 'true' id: wx-cache uses: actions/cache/restore@v4 continue-on-error: true diff --git a/ci/check-wx-image-prefix.sh b/ci/check-wx-image-prefix.sh new file mode 100644 index 00000000..30f311b3 --- /dev/null +++ b/ci/check-wx-image-prefix.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MIT +# Avoid a runner-local cache download when the pinned image has this source. +set -euo pipefail + +prefix="${WX_PREFIX:?WX_PREFIX is required}" +expected="$(awk '$1 == "sha256:" {print $2}' thirdparty/wxwidgets/VERSION)" +[[ "$expected" =~ ^[0-9a-f]{64}$ ]] +available=false +if [ ! -L "$prefix" ] && [ ! -L "$prefix/.alkane-source-sha256" ] && + [ -x "$prefix/bin/wx-config" ] && + [ -s "$prefix/lib/libwx_gtk3u-3.3.a" ] && + [ "$(cat "$prefix/.alkane-source-sha256" 2>/dev/null || true)" = "$expected" ]; then + available=true +fi +printf 'available=%s\n' "$available" >> "${GITHUB_OUTPUT:?GITHUB_OUTPUT is required}" diff --git a/ci/runner-image.txt b/ci/runner-image.txt index 21db8c24..6781c89d 100644 --- a/ci/runner-image.txt +++ b/ci/runner-image.txt @@ -1 +1 @@ -gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 +gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15