|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +# E2E, aspect, benchmark, and panic-attack CI for Absolute Zero |
| 3 | +name: E2E + Aspect + Bench + Security |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + pull_request: |
| 9 | + branches: [main] |
| 10 | + |
| 11 | +permissions: read-all |
| 12 | + |
| 13 | +jobs: |
| 14 | + rust-build-test: |
| 15 | + name: Rust Build + Unit Tests |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 19 | + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
| 20 | + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 |
| 21 | + - name: Build |
| 22 | + run: cd absolute-zero && cargo build --release |
| 23 | + - name: Unit tests |
| 24 | + run: cd absolute-zero && cargo test -- --test-threads=1 |
| 25 | + - name: Clippy |
| 26 | + run: cd absolute-zero && cargo clippy -- -D warnings || true |
| 27 | + - name: Format check |
| 28 | + run: cd absolute-zero && cargo fmt -- --check || true |
| 29 | + |
| 30 | + benchmarks: |
| 31 | + name: Criterion Benchmarks |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 35 | + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
| 36 | + - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 |
| 37 | + - name: Run benchmarks |
| 38 | + run: cd absolute-zero && cargo bench --bench cno_benchmarks -- --output-format bencher 2>/dev/null || echo "Benchmarks completed (may have warnings)" |
| 39 | + |
| 40 | + aspect-tests: |
| 41 | + name: Aspect Tests (Cross-Cutting) |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 45 | + - name: Run aspect tests |
| 46 | + run: bash absolute-zero/tests/aspect/cross_cutting_test.sh |
| 47 | + |
| 48 | + e2e-proofs: |
| 49 | + name: E2E Proof Verification |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 53 | + - uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable |
| 54 | + - name: Install proof tools |
| 55 | + run: | |
| 56 | + sudo apt-get update -qq |
| 57 | + sudo apt-get install -y -qq z3 || true |
| 58 | + - name: Run E2E verification |
| 59 | + run: bash absolute-zero/tests/e2e/proof_verification_e2e.sh |
| 60 | + |
| 61 | + panic-attack: |
| 62 | + name: Panic Attack Security Scan |
| 63 | + runs-on: ubuntu-latest |
| 64 | + if: github.event_name == 'push' |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 67 | + - name: Install panic-attack |
| 68 | + run: | |
| 69 | + cargo install panic-attacker || echo "panic-attack not available in CI — skipping" |
| 70 | + - name: Run assail scan |
| 71 | + run: | |
| 72 | + if command -v panic-attack >/dev/null 2>&1; then |
| 73 | + panic-attack assail absolute-zero/ --output-format json --output panic-attack-report.json --quiet || true |
| 74 | + echo "=== Weak Points ===" |
| 75 | + python3 -c "import json; d=json.load(open('panic-attack-report.json')); print(f'Total: {len(d.get(\"weak_points\",[]))}')" || true |
| 76 | + else |
| 77 | + echo "panic-attack not installed — skipping" |
| 78 | + fi |
0 commit comments