Skip to content

docs: fix run response shape, exit code 2 wording, and tolerance frac… #213

docs: fix run response shape, exit code 2 wording, and tolerance frac…

docs: fix run response shape, exit code 2 wording, and tolerance frac… #213

Workflow file for this run

name: CI
on:
push:
branches: [production, main, feature/*]
pull_request:
branches: [production, main]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check + Clippy + Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Cargo Check (all targets)
run: cargo check --all-targets
- name: Clippy (strict — no warnings)
run: cargo clippy -- -D warnings
- name: Unit + property-based tests
run: cargo test --bins
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build Release
run: cargo build --release --target ${{ matrix.target }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: barzel-${{ matrix.target }}
path: target/${{ matrix.target }}/release/barzel${{ matrix.os == 'windows-latest' && '.exe' || '' }}
self-test:
name: Self-Test (Barzel tests itself)
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build Barzel
run: cargo build --release
- name: Run Barzel on itself
run: ./target/release/barzel run
- name: Validate report
run: |
REPORT=$(ls .barzel/reports/*.json | sort | tail -1)
echo "Report: $REPORT"
python3 - "$REPORT" <<'PYEOF'
import json, sys
with open(sys.argv[1]) as f:
report = json.load(f)
layers = report['layers']
print(f"Report status: {report['status']}")
print(f"Runners: {[(l['runner'], l['name'], l['status']) for l in layers]}")
# At minimum, proptest must have run and passed (it's always available on this Rust repo)
proptest = next((l for l in layers if l['runner'] == 'proptest'), None)
assert proptest is not None, "proptest runner missing from report"
assert proptest['status'] == 'pass', f"proptest status: {proptest['status']}"
print(f"proptest: {proptest['metrics']['tests_run']} tests run")
# Every layer that ran (not skipped) must not be Critical-fail — skipped is fine
for layer in layers:
if layer['status'] == 'fail':
critical = [f for f in layer['findings'] if f['severity'] == 'critical']
assert not critical, f"Runner {layer['runner']} has critical failures: {critical}"
print("All assertions passed.")
PYEOF
- name: Show full report
if: always()
run: ./target/release/barzel report || true