Bring the Oct 18-20 CI hardening on main into the afw OS-bundle line before
promoting it to main. Resolution:
- src/{main,lib,hal_wire,management}.rs, Cargo.toml, Cargo.lock: the branch
side; it is a superset of main's (main's ALKANE_API_LISTEN management API now
lives in src/app.rs and is wired for every run mode).
- workflows: main's runner-image pin (ad56db2f) and conditional SSH install,
main's workflow_run triggers for the badge and Pages publishers, next's
CARGO_BUILD_JOBS=2; the branch's extra gates (image safety, .afw tests,
research/evidence, version checks, evidence-status artifact) are kept.
- ci/last-attempt-badge.py + its test, ci/publish-bench-pages.py: main's
(workflow_run events; stderr detail on failure). ci/cleanup-generated.py: the
branch's (also cleans the evidence-status file the kept step writes).
- README.md, ci/CONFORMANCE.md: the branch's (documents the web console and
the evidence-status report, both present in the merged tree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
141 lines
5.5 KiB
YAML
141 lines
5.5 KiB
YAML
name: main-release-gate
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: alkane-os-main
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
verify-and-release:
|
|
runs-on: alkane-ci
|
|
container:
|
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Pages SSH client
|
|
run: |
|
|
if ! command -v ssh >/dev/null 2>&1; then
|
|
apt-get update -qq
|
|
apt-get install -y -qq --no-install-recommends openssh-client
|
|
fi
|
|
- name: Install Rust quality tools
|
|
run: rustup component add rustfmt clippy
|
|
- name: Image safety gate
|
|
run: sh ci/check-image-safety.sh
|
|
- name: .afw format tests
|
|
run: python3 ci/test-afw.py
|
|
- name: Formatting
|
|
run: cargo fmt --check
|
|
- name: Last-attempt badge checks
|
|
run: python3 ci/test-last-attempt-badge.py
|
|
- name: Benchmark history checks
|
|
run: python3 ci/test-bench-history.py
|
|
- name: Metric badge checks
|
|
run: python3 ci/test-metrics.py
|
|
- name: Release evidence gate checks
|
|
run: python3 ci/test-conformance.py
|
|
- name: Research and experiment report checks
|
|
run: |
|
|
python3 ci/test-evidence-status.py
|
|
python3 ci/test-experiment-priority.py
|
|
python3 ci/test-pr-surface.py
|
|
- name: Release publication checks
|
|
run: python3 ci/test-release.py
|
|
- name: Release version checks
|
|
run: python3 ci/test-version.py
|
|
- name: CI cleanup containment checks
|
|
run: python3 ci/test-cleanup-generated.py
|
|
- name: Quality
|
|
run: |
|
|
cargo clippy --all-targets --locked -- -D warnings
|
|
printf '{"format":true,"clippy_warnings_denied":true}\n' > quality-current.json
|
|
- name: Build
|
|
run: cargo build --release --locked
|
|
- name: Unit and workflow tests
|
|
run: |
|
|
set -o pipefail
|
|
cargo test --locked 2>&1 | tee tests-current.txt
|
|
- name: Microbenchmarks
|
|
run: |
|
|
set -o pipefail
|
|
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
|
- name: Coverage tool
|
|
run: |
|
|
rustup component add llvm-tools-preview
|
|
[ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ]
|
|
- name: Unit test coverage
|
|
run: |
|
|
mkdir -p coverage
|
|
CARGO_TARGET_DIR=target/coverage-tests cargo llvm-cov --json \
|
|
--output-path coverage/tests.json --locked
|
|
- name: Microbenchmark coverage
|
|
run: |
|
|
CARGO_TARGET_DIR=target/coverage-bench cargo llvm-cov --json \
|
|
--output-path coverage/bench.json --locked -- --ignored
|
|
- name: Load previous main benchmark measurement
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/bench_history.py prepare
|
|
- name: Generate measured badges
|
|
run: |
|
|
python3 ci/metrics.py --tests-output tests-current.txt \
|
|
--tests-coverage coverage/tests.json --bench-output bench-current.txt \
|
|
--bench-coverage coverage/bench.json --quality-gate quality-current.json
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
|
|
with:
|
|
name: alkane-os-metrics
|
|
path: |
|
|
badges/metrics.json
|
|
quality-current.json
|
|
coverage/tests.json
|
|
coverage/bench.json
|
|
bench-current.txt
|
|
- name: Publish measured badges privately
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/publish-metrics.py
|
|
- name: Record private benchmark history
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/bench_history.py publish
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
|
|
with:
|
|
name: alkane-os-benchmark-site-preview
|
|
path: bench-site/index.html
|
|
- name: Separate research from release evidence
|
|
run: python3 ci/evidence_status.py --output evidence-status-current.json
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
|
|
with:
|
|
name: alkane-os-evidence-status
|
|
path: evidence-status-current.json
|
|
- name: Pairing and simulator conformance
|
|
run: python3 ci/check-conformance.py
|
|
- name: Select release version
|
|
id: version
|
|
run: python3 ci/version.py main >> "$GITHUB_OUTPUT"
|
|
- name: Package source and benchmark result
|
|
if: steps.version.outputs.release == 'true'
|
|
run: |
|
|
mkdir -p dist
|
|
git archive --format=tar.gz --output="dist/alkane-os-${{ steps.version.outputs.version }}-source.tar.gz" HEAD
|
|
cp target/release/alkane-os dist/
|
|
cp bench-current.txt dist/
|
|
- name: Create private release
|
|
if: steps.version.outputs.release == 'true'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: python3 ci/release.py "${{ steps.version.outputs.tag }}" false "dist/alkane-os-${{ steps.version.outputs.version }}-source.tar.gz" dist/alkane-os dist/bench-current.txt
|
|
- name: Clean generated build and benchmark work
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|