From c3efda87c33c33eddb3bf27414a2dac1ed19404f Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 18 Oct 2026 21:29:33 -0600 Subject: [PATCH] Cover all Toolkit crates and pin CI image --- .gitea/workflows/ci-badge.yml | 2 ++ .gitea/workflows/next.yml | 4 ++++ .gitea/workflows/release.yml | 9 +++++++-- .gitea/workflows/source.yml | 6 +++++- .gitea/workflows/verify.yml | 13 +++++++++++-- ci/check-runner-image.py | 35 +++++++++++++++++++++++++++++++++++ ci/runner-image.txt | 1 + 7 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 ci/check-runner-image.py create mode 100644 ci/runner-image.txt diff --git a/.gitea/workflows/ci-badge.yml b/.gitea/workflows/ci-badge.yml index 3a8e9c7b..85065fa3 100644 --- a/.gitea/workflows/ci-badge.yml +++ b/.gitea/workflows/ci-badge.yml @@ -8,6 +8,8 @@ on: jobs: publish: runs-on: alkane-fast + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 permissions: actions: read contents: write diff --git a/.gitea/workflows/next.yml b/.gitea/workflows/next.yml index 0abdb943..ac8a7dae 100644 --- a/.gitea/workflows/next.yml +++ b/.gitea/workflows/next.yml @@ -14,6 +14,8 @@ permissions: jobs: candidate: runs-on: alkane-ci + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 env: CARGO_TARGET_DIR: target WX_PREFIX: /root/.cache/wx-3.3.3-linux @@ -22,6 +24,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Check runner image pins + run: python3 ci/check-runner-image.py - name: Install build dependencies run: bash ci/ensure-build-deps.sh base - name: Compute wxWidgets cache key diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 6c3cc36f..d5924c3b 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -17,6 +17,8 @@ permissions: jobs: release: runs-on: alkane-ci + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 env: CARGO_TARGET_DIR: target WX_PREFIX: /root/.cache/wx-3.3.3-linux @@ -29,6 +31,9 @@ jobs: with: fetch-depth: 0 + - name: Check runner image pins + run: python3 ci/check-runner-image.py + - name: Compute version id: ver run: bash ci/compute-version.sh | tee -a "$GITHUB_OUTPUT" @@ -82,7 +87,7 @@ jobs: run: | rustup component add clippy >/dev/null 2>&1 || true cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings - cargo clippy -p alkane-artifacts -p alkane-flash -p alkane-cli --all-targets --offline -- -D warnings + cargo clippy --workspace --exclude alkane-gui --exclude wx-rs --all-targets --offline -- -D warnings - name: Set crate version to ${{ steps.ver.outputs.version }} if: steps.ver.outputs.release == 'true' @@ -98,7 +103,7 @@ jobs: run: | set -o pipefail cargo test -p alkane-gui --offline 2>&1 | tee tests-gui.txt - cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline 2>&1 | tee tests-core.txt + cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline 2>&1 | tee tests-core.txt cat tests-gui.txt tests-core.txt > tests-current.txt - name: Load previous main benchmark measurement diff --git a/.gitea/workflows/source.yml b/.gitea/workflows/source.yml index 104cae79..6cd3af40 100644 --- a/.gitea/workflows/source.yml +++ b/.gitea/workflows/source.yml @@ -13,12 +13,16 @@ concurrency: jobs: check: runs-on: alkane-fast + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 env: CARGO_BUILD_JOBS: 2 steps: - uses: actions/checkout@v4 + - name: Check runner image pins + run: python3 ci/check-runner-image.py - name: Source checks - run: cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline + run: cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline - name: Clean generated Toolkit build if: always() run: python3 ci/cleanup-generated.py diff --git a/.gitea/workflows/verify.yml b/.gitea/workflows/verify.yml index d8ba3679..b1001067 100644 --- a/.gitea/workflows/verify.yml +++ b/.gitea/workflows/verify.yml @@ -5,9 +5,15 @@ on: pull_request: branches: [main] +concurrency: + group: alkane-toolkit-verify-${{ github.ref }} + cancel-in-progress: true + jobs: verify: runs-on: alkane-verify + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732 env: CARGO_TARGET_DIR: target CARGO_BUILD_JOBS: 2 @@ -19,6 +25,9 @@ jobs: with: fetch-depth: 0 + - name: Check runner image pins + run: python3 ci/check-runner-image.py + - name: Detect changed surface id: surface run: python3 ci/pr-surface.py >> "$GITHUB_OUTPUT" @@ -81,7 +90,7 @@ jobs: run: | rustup component add clippy >/dev/null 2>&1 || true cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings - cargo clippy -p alkane-artifacts -p alkane-flash -p alkane-cli --all-targets --offline -- -D warnings + cargo clippy --workspace --exclude alkane-gui --exclude wx-rs --all-targets --offline -- -D warnings - name: Headless crate checks if: steps.surface.outputs.surface == 'headless' @@ -108,7 +117,7 @@ jobs: if: steps.surface.outputs.surface == 'full' run: | cargo test -p alkane-gui --offline - cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline + cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline - name: Microbenchmarks if: steps.surface.outputs.surface == 'full' diff --git a/ci/check-runner-image.py b/ci/check-runner-image.py new file mode 100644 index 00000000..6f9d5fd6 --- /dev/null +++ b/ci/check-runner-image.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""Keep Toolkit CI on the verified Alkane runner image.""" + +from pathlib import Path +import re +import sys + +import yaml + + +ROOT = Path(__file__).resolve().parents[1] +IMAGE = (ROOT / "ci/runner-image.txt").read_text().strip() + + +def main() -> int: + if not re.fullmatch( + r"gitea\.bluefla\.re/blueflare/alkane-ci@sha256:[0-9a-f]{64}", IMAGE + ): + print("Runner image must be pinned by Gitea registry digest", file=sys.stderr) + return 1 + for path in sorted((ROOT / ".gitea/workflows").glob("*.yml")): + workflow = yaml.load(path.read_text(), Loader=yaml.BaseLoader) + for name, job in workflow.get("jobs", {}).items(): + if job.get("runs-on") not in {"alkane-ci", "alkane-fast", "alkane-verify"}: + continue + if job.get("container", {}).get("image") != IMAGE: + print(f"{path.name}: {name} has a different runner image", file=sys.stderr) + return 1 + print("Toolkit runner image pins: PASS") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/ci/runner-image.txt b/ci/runner-image.txt new file mode 100644 index 00000000..21db8c24 --- /dev/null +++ b/ci/runner-image.txt @@ -0,0 +1 @@ +gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732