From 7320121b4230c524bda91fd36c119a5a9d002a2a Mon Sep 17 00:00:00 2001 From: Noah <2+noah@noreply.gitea.bluefla.re> Date: Wed, 21 Oct 2026 06:51:32 -0600 Subject: [PATCH 1/2] Add fast next pull request source gate --- .gitea/workflows/source.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitea/workflows/source.yml diff --git a/.gitea/workflows/source.yml b/.gitea/workflows/source.yml new file mode 100644 index 00000000..bc6a490d --- /dev/null +++ b/.gitea/workflows/source.yml @@ -0,0 +1,51 @@ +name: source + +on: + pull_request: + branches: [next] + +concurrency: + group: alkane-toolkit-source-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + runs-on: alkane-fast + container: + image: gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check changed source + run: | + base="$(git merge-base HEAD origin/next)" + git diff --check "$base" HEAD + python3 - <<'PY' + from pathlib import Path + for path in Path('ci').glob('*.py'): + compile(path.read_text(), str(path), 'exec') + PY + for script in ci/*.sh scripts/*.sh; do + bash -n "$script" + done + - name: Check non-GUI Rust format + run: | + rustup component add rustfmt + cargo fmt --check \ + --package alkane-core \ + --package alkane-discovery \ + --package alkane-access \ + --package alkane-flash \ + --package alkane-artifacts \ + --package alkane-cli + - name: Check non-GUI Rust crates + env: + CARGO_TARGET_DIR: target + run: | + cargo check --offline --locked \ + -p alkane-core -p alkane-discovery -p alkane-access \ + -p alkane-flash -p alkane-artifacts -p alkane-cli + - name: Clean generated work + if: always() + run: python3 ci/cleanup-generated.py -- 2.54.0 From bf559326a783c7b49c5f49b09e26a292b14a2369 Mon Sep 17 00:00:00 2001 From: Noah <2+noah@noreply.gitea.bluefla.re> Date: Wed, 21 Oct 2026 06:54:48 -0600 Subject: [PATCH 2/2] Scope Toolkit source checks to changed Rust --- .gitea/workflows/source.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitea/workflows/source.yml b/.gitea/workflows/source.yml index bc6a490d..f8733e48 100644 --- a/.gitea/workflows/source.yml +++ b/.gitea/workflows/source.yml @@ -18,9 +18,30 @@ jobs: with: fetch-depth: 0 - name: Check changed source + id: surface run: | base="$(git merge-base HEAD origin/next)" git diff --check "$base" HEAD + python3 - "$base" <<'PY' >> "$GITHUB_OUTPUT" + import subprocess + import sys + + changed = subprocess.check_output( + ['git', 'diff', '--name-only', '-z', sys.argv[1], 'HEAD'] + ).split(b'\0') + rust_prefixes = ( + b'crates/alkane-core/', b'crates/alkane-discovery/', + b'crates/alkane-access/', b'crates/alkane-flash/', + b'crates/alkane-artifacts/', b'crates/alkane-cli/', + b'thirdparty/asic-rs/', b'.cargo/', + ) + rust = any( + path in (b'Cargo.toml', b'Cargo.lock', b'rust-toolchain.toml') + or path.startswith(rust_prefixes) + for path in changed if path + ) + print(f"rust={'true' if rust else 'false'}") + PY python3 - <<'PY' from pathlib import Path for path in Path('ci').glob('*.py'): @@ -30,6 +51,7 @@ jobs: bash -n "$script" done - name: Check non-GUI Rust format + if: steps.surface.outputs.rust == 'true' run: | rustup component add rustfmt cargo fmt --check \ @@ -40,6 +62,7 @@ jobs: --package alkane-artifacts \ --package alkane-cli - name: Check non-GUI Rust crates + if: steps.surface.outputs.rust == 'true' env: CARGO_TARGET_DIR: target run: | -- 2.54.0