Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75b7424a0d | ||
|
|
8d4fe502be | ||
|
|
038c1b1c2b | ||
|
|
20d7f49c9d | ||
|
|
74cee50d35 | ||
|
|
32a75c92ef | ||
|
|
f4d9c12bb6 |
@@ -11,7 +11,9 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: alkane-pages
|
||||
runs-on: alkane-verify
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
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
|
||||
id: surface
|
||||
run: |
|
||||
base="$(git merge-base HEAD origin/next)"
|
||||
git diff --check "$base" HEAD
|
||||
python3 - "$base" <<'PY' >> "$GITHUB_OUTPUT"
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
changed = subprocess.check_output(
|
||||
['git', 'diff', '--name-only', '-z', sys.argv[1], 'HEAD']
|
||||
).split(b'\0')
|
||||
pem = re.compile(
|
||||
rb'^[ \t]*-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----[ \t]*$'
|
||||
)
|
||||
for raw in changed:
|
||||
path = Path(os.fsdecode(raw))
|
||||
if not raw or not path.is_file() or path.is_symlink():
|
||||
continue
|
||||
with path.open('rb') as source:
|
||||
for number, line in enumerate(source, 1):
|
||||
if pem.fullmatch(line.rstrip(b'\r\n')):
|
||||
print(f'private key material: {path}:{number}', file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
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'):
|
||||
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
|
||||
if: steps.surface.outputs.rust == 'true'
|
||||
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
|
||||
if: steps.surface.outputs.rust == 'true'
|
||||
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
|
||||
@@ -1,14 +1,14 @@
|
||||
name: verify
|
||||
|
||||
# Pre-merge quality gate: clippy + build + tests + microbenchmarks + the headless
|
||||
# UI self-test, plus a best-effort dependency audit. Runs on pull requests and on
|
||||
# pushes to any branch EXCEPT main (main is gated by release.yml, which repeats
|
||||
# these checks before it cuts a release -- so no work is duplicated on main).
|
||||
# Full quality gate for pull requests to main. The fast source workflow checks
|
||||
# pull requests to next, and branch workflows build after each merge.
|
||||
on:
|
||||
pull_request:
|
||||
branches-ignore: [next]
|
||||
push:
|
||||
branches-ignore: [main, next]
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: alkane-toolkit-verify-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
|
||||
Reference in New Issue
Block a user