- ci/windows-ci.sh is the one definition of every Windows step (toolchain, clippy, build, tests and UI self-test under Wine, packaging, test bundle); verify, release and next only call it. - release.yml: a windows job builds, tests and packages alkane-toolkit-vX.Y.Z-windows-x86_64.zip; the release job waits for it and attaches the zip next to the Linux tarball. next.yml does the same for -rc candidates, verify.yml runs the Windows gates on PRs. - windows-native.yml (advisory, never gates a release) runs main's cross-built unit tests and UI self-test on real Windows 11 through the self-hosted VM runner (label alkane-windows). - CI image: ci/images/alkane-ci.Dockerfile layers mingw-w64, Wine with a ready prefix, the rustup target and a prebuilt wxMSW prefix on the previously verified image; ci/images/build-image.sh pushes it and pins the digest. wx prefix/cache scripts take a linux|windows argument. - CI checks the wx-rs patch queue; versioning treats the GUI build script, Windows resources and assets as release-relevant; the workflow contract test covers the Windows gates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
263 lines
9.5 KiB
YAML
263 lines
9.5 KiB
YAML
name: verify
|
|
|
|
# Full quality gate for pull requests to main.
|
|
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:8f20439b38ae1c070b1a692a89c084f69134f4fa16a755d02783f621cd9ac041
|
|
outputs:
|
|
surface: ${{ steps.surface.outputs.surface }}
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
CARGO_BUILD_JOBS: 2
|
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
|
WX_RS_WXCONFIG: /root/.cache/wx-3.3.3-linux/bin/wx-config
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check runner image pins
|
|
run: python3 ci/check-runner-image.py
|
|
|
|
- name: Check wx-rs patch queue reproduces the patched tree
|
|
run: python3 scripts/wx_rs_patches.py check
|
|
|
|
- name: Detect changed surface
|
|
id: surface
|
|
run: python3 ci/pr-surface.py >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Check documentation change
|
|
if: steps.surface.outputs.surface == 'documentation'
|
|
run: |
|
|
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF")"
|
|
git diff --check "$base" HEAD
|
|
if git grep -nIE '^[[:space:]]*-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----[[:space:]]*$' --; then
|
|
echo "private key material found in tracked source" >&2
|
|
exit 1
|
|
else
|
|
status=$?
|
|
[ "$status" -eq 1 ]
|
|
fi
|
|
|
|
- name: Check CI change surface
|
|
if: steps.surface.outputs.surface != 'documentation'
|
|
run: python3 ci/test-pr-surface.py
|
|
|
|
- name: Check first-party Rust formatting
|
|
if: steps.surface.outputs.surface == 'headless' || steps.surface.outputs.surface == 'full'
|
|
run: |
|
|
rustup component add rustfmt >/dev/null
|
|
cargo fmt -p alkane-gui -p alkane-artifacts -p alkane-flash -p alkane-cli -p alkane-access -p alkane-core -- --check
|
|
|
|
|
|
- name: Check workflow-only change
|
|
if: steps.surface.outputs.surface == 'workflow'
|
|
run: |
|
|
python3 - <<'PY'
|
|
from pathlib import Path
|
|
import yaml
|
|
for path in Path('.gitea/workflows').glob('*.yml'):
|
|
yaml.load(path.read_text(), Loader=yaml.BaseLoader)
|
|
PY
|
|
python3 ci/check-runner-image.py
|
|
for script in ci/*.sh; do bash -n "$script"; done
|
|
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF")"
|
|
git diff --check "$base" HEAD
|
|
if git grep -nIE '^[[:space:]]*-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----[[:space:]]*$' --; then
|
|
echo "private key material found in tracked source" >&2
|
|
exit 1
|
|
else
|
|
status=$?
|
|
[ "$status" -eq 1 ]
|
|
fi
|
|
|
|
- name: Install build dependencies
|
|
if: steps.surface.outputs.surface == 'headless' || steps.surface.outputs.surface == 'full'
|
|
run: bash ci/ensure-build-deps.sh base
|
|
|
|
- name: Configure bounded Rust compiler cache
|
|
if: steps.surface.outputs.surface == 'headless' || steps.surface.outputs.surface == 'full'
|
|
run: bash ci/configure-rust-cache.sh
|
|
|
|
- name: Compute wxWidgets cache key
|
|
id: wx-key
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: bash ci/wx-cache-key.sh
|
|
|
|
- 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
|
|
with:
|
|
path: /root/.cache/wx-3.3.3-linux
|
|
key: ${{ steps.wx-key.outputs.key }}
|
|
|
|
- name: Build wxWidgets (once, then cached)
|
|
if: steps.surface.outputs.surface == 'full'
|
|
id: wx-build
|
|
run: bash ci/ensure-wx-prefix.sh
|
|
|
|
- name: Save vendored wxWidgets build
|
|
if: steps.surface.outputs.surface == 'full' && steps.wx-cache.outputs.cache-hit != 'true' && steps.wx-build.outputs.built == 'true'
|
|
uses: actions/cache/save@v4
|
|
continue-on-error: true
|
|
with:
|
|
path: /root/.cache/wx-3.3.3-linux
|
|
key: ${{ steps.wx-key.outputs.key }}
|
|
|
|
- name: Clippy (our crate, warnings are errors)
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: |
|
|
rustup component add clippy >/dev/null 2>&1 || true
|
|
cargo clippy -p alkane-gui --no-deps --release --bins --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'
|
|
env:
|
|
PACKAGES: ${{ steps.surface.outputs.packages }}
|
|
run: |
|
|
rustup component add clippy >/dev/null 2>&1 || true
|
|
args=()
|
|
for package in $PACKAGES; do
|
|
case "$package" in
|
|
alkane-access|alkane-artifacts|alkane-cli|alkane-flash) args+=(-p "$package") ;;
|
|
*) echo "unrecognized crate: $package" >&2; exit 1 ;;
|
|
esac
|
|
done
|
|
[ "${#args[@]}" -gt 0 ]
|
|
cargo clippy "${args[@]}" --all-targets --offline -- -D warnings
|
|
cargo test "${args[@]}" --offline
|
|
|
|
- name: Build
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: cargo build --release -p alkane-gui --offline
|
|
|
|
- name: Unit tests
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: |
|
|
cargo test -p alkane-gui --offline
|
|
cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline
|
|
|
|
- name: Microbenchmarks
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: cargo test -p alkane-gui -p alkane-artifacts --release --offline -- --ignored --nocapture bench_ --test-threads=1
|
|
|
|
- name: Headless UI self-test
|
|
if: steps.surface.outputs.surface == 'full'
|
|
run: |
|
|
bash ci/ensure-build-deps.sh ui
|
|
BIN=target/release/alkane-toolkit
|
|
xvfb-run -a env GDK_BACKEND=x11 ALKANE_SELFTEST=1 "$BIN"
|
|
|
|
# Advisory audit is best-effort: it needs the RustSec DB over the network,
|
|
# which the vendored/offline build otherwise never touches, so a locked-down
|
|
# runner must not fail the gate on it. Accepted advisories live in
|
|
# .cargo/audit.toml.
|
|
- name: Dependency audit (best-effort)
|
|
if: steps.surface.outputs.surface == 'headless' || steps.surface.outputs.surface == 'full'
|
|
continue-on-error: true
|
|
run: |
|
|
if command -v cargo-audit >/dev/null 2>&1; then
|
|
cargo audit || echo "cargo audit reported findings (see .cargo/audit.toml for accepted ones)"
|
|
else
|
|
echo "cargo-audit not installed on this runner; skipping"
|
|
fi
|
|
- name: Rust compiler cache statistics
|
|
if: always() && (steps.surface.outputs.surface == 'headless' || steps.surface.outputs.surface == 'full')
|
|
run: |
|
|
if [ -n "${SCCACHE_DIR:-}" ]; then
|
|
sccache --show-stats
|
|
fi
|
|
- name: Clean generated Toolkit build
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|
|
|
|
# The Windows build of the same change (main's release gate, run on the PR):
|
|
# clippy for the Windows target, the release .exe, every unit test under
|
|
# Wine, and the headless UI self-test under Wine. Only for changes that can
|
|
# affect the binary (the "full" surface).
|
|
verify-windows:
|
|
needs: verify
|
|
if: needs.verify.outputs.surface == 'full'
|
|
runs-on: alkane-verify
|
|
container:
|
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:8f20439b38ae1c070b1a692a89c084f69134f4fa16a755d02783f621cd9ac041
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
CARGO_BUILD_JOBS: 2
|
|
WX_WINDOWS_PREFIX: /root/.cache/wx-3.3.3-mingw
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Windows toolchain
|
|
run: bash ci/windows-ci.sh toolchain
|
|
|
|
- name: Configure bounded Rust compiler cache
|
|
run: bash ci/configure-rust-cache.sh
|
|
|
|
- name: Compute wxMSW cache key
|
|
id: wx-key
|
|
run: bash ci/wx-cache-key.sh windows
|
|
|
|
- name: Check prebuilt wxMSW
|
|
id: wx-image
|
|
run: bash ci/check-wx-image-prefix.sh windows
|
|
|
|
- name: Cache vendored wxMSW build
|
|
if: steps.wx-image.outputs.available != 'true'
|
|
id: wx-cache
|
|
uses: actions/cache/restore@v4
|
|
continue-on-error: true
|
|
with:
|
|
path: /root/.cache/wx-3.3.3-mingw
|
|
key: ${{ steps.wx-key.outputs.key }}
|
|
|
|
- name: Build wxMSW (once, then cached)
|
|
id: wx-build
|
|
run: bash ci/ensure-wx-prefix.sh windows
|
|
|
|
- name: Save vendored wxMSW build
|
|
if: steps.wx-cache.outputs.cache-hit != 'true' && steps.wx-build.outputs.built == 'true'
|
|
uses: actions/cache/save@v4
|
|
continue-on-error: true
|
|
with:
|
|
path: /root/.cache/wx-3.3.3-mingw
|
|
key: ${{ steps.wx-key.outputs.key }}
|
|
|
|
- name: Clippy (Windows target, warnings are errors)
|
|
run: bash ci/windows-ci.sh clippy
|
|
|
|
- name: Build (Windows)
|
|
run: bash ci/windows-ci.sh build
|
|
|
|
- name: Unit tests (Windows build, under Wine)
|
|
run: bash ci/windows-ci.sh test
|
|
|
|
- name: Headless UI self-test (Windows build, under Wine)
|
|
run: bash ci/windows-ci.sh selftest
|
|
|
|
- name: Clean generated Toolkit build
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|