Sprint 45: Coverage + CLI Hardening — accurate builtin coverage audit… #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --all | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| llvm-check: | |
| name: LLVM Feature Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install LLVM 18 and link dependencies | |
| run: | | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
| echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee /etc/apt/sources.list.d/llvm-18.list | |
| sudo apt-get update | |
| sudo apt-get install -y llvm-18-dev libzstd-dev libpolly-18-dev | |
| - name: Clippy LLVM feature (zero warnings) | |
| run: cargo clippy --features llvm --all-targets -- -D warnings | |
| - name: Verify LLVM test targets compile | |
| run: cargo test --features llvm --no-run | |
| runtime-test: | |
| name: Runtime Crate Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run runtime tests | |
| run: cd runtime && cargo test | |
| forma-tests: | |
| name: FORMA Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run .forma test files | |
| run: | | |
| PASS=0 | |
| FAIL=0 | |
| for f in tests/forma/*.forma; do | |
| name=$(basename "$f") | |
| if ./target/release/forma run --allow-all "$f" > /dev/null 2>&1; then | |
| echo "PASS: $name" | |
| PASS=$((PASS + 1)) | |
| else | |
| echo "FAIL: $name" | |
| FAIL=$((FAIL + 1)) | |
| fi | |
| done | |
| echo "" | |
| echo "Results: $PASS passed, $FAIL failed" | |
| if [ "$FAIL" -gt 0 ]; then exit 1; fi | |
| coverage-audit: | |
| name: Builtin Coverage Audit | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run coverage audit (enforce 70% threshold) | |
| run: bash scripts/builtin_coverage.sh --enforce 70 | tee coverage-report.txt | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: builtin-coverage-report | |
| path: coverage-report.txt | |
| showcase: | |
| name: Showcase Examples | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run showcase examples | |
| run: | | |
| PASS=0 | |
| FAIL=0 | |
| for f in examples/showcase/*.forma; do | |
| name=$(basename "$f") | |
| if ./target/release/forma run --allow-all "$f" > /dev/null 2>&1; then | |
| echo "PASS: $name" | |
| PASS=$((PASS + 1)) | |
| else | |
| echo "FAIL: $name" | |
| FAIL=$((FAIL + 1)) | |
| fi | |
| done | |
| echo "" | |
| echo "Results: $PASS passed, $FAIL failed" | |
| if [ "$FAIL" -gt 0 ]; then exit 1; fi |