fix(builder): harden input() against CSE aliasing #33
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: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-test: | |
| name: Build & Test (Rust) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry & build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run tests | |
| run: cargo test --release | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| - name: Clippy lints | |
| run: cargo clippy --release -- -D warnings | |
| verify-benchmarks: | |
| name: Verify BTOR2 Models | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install btor2tools (catbtor + btorsim) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake g++ | |
| git clone --depth 1 https://github.com/Boolector/btor2tools.git /tmp/btor2tools | |
| cd /tmp/btor2tools | |
| mkdir build && cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j$(nproc) | |
| sudo cp bin/catbtor bin/btorsim /usr/local/bin/ | |
| - name: Validate BTOR2 syntax (C rotor benchmarks) | |
| run: | | |
| echo "Validating C rotor BTOR2 files..." | |
| errors=0 | |
| for f in benchmarks/btor2-c-rotor/*.btor2; do | |
| if catbtor "$f" > /dev/null 2>&1; then | |
| echo " ✓ $(basename $f)" | |
| else | |
| echo " ✗ $(basename $f) — parse error" | |
| errors=$((errors + 1)) | |
| fi | |
| done | |
| echo "Checked $(ls benchmarks/btor2-c-rotor/*.btor2 | wc -l) files, $errors errors" | |
| [ $errors -eq 0 ] | |
| - name: Validate BTOR2 syntax (Rust rotor benchmarks) | |
| run: | | |
| echo "Validating Rust rotor BTOR2 files..." | |
| errors=0 | |
| for f in benchmarks/btor2-rust-rotor/*.btor2; do | |
| if catbtor "$f" > /dev/null 2>&1; then | |
| echo " ✓ $(basename $f)" | |
| else | |
| echo " ✗ $(basename $f) — parse error" | |
| errors=$((errors + 1)) | |
| fi | |
| done | |
| echo "Checked $(ls benchmarks/btor2-rust-rotor/*.btor2 | wc -l) files, $errors errors" | |
| [ $errors -eq 0 ] | |
| - name: Validate visualizer example models | |
| run: | | |
| for f in visualizer/examples/*.btor2; do | |
| if catbtor "$f" > /dev/null 2>&1; then | |
| echo " ✓ $(basename $f)" | |
| else | |
| echo " ✗ $(basename $f) — parse error" | |
| exit 1 | |
| fi | |
| done | |
| - name: Simulate counter model with btorsim | |
| run: | | |
| echo "Simulating counter-with-input with witness trace..." | |
| btorsim -b visualizer/examples/counter-with-input.btor2 \ | |
| visualizer/examples/counter-with-input.wit 2>&1 | tail -5 | |
| echo "Simulation completed successfully" | |
| visualizer-lint: | |
| name: Visualizer (JS Lint) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check JS syntax | |
| run: | | |
| for f in visualizer/js/*.js; do | |
| echo "Checking $(basename $f)..." | |
| node --check "$f" | |
| done | |
| echo "All JS files have valid syntax" | |
| - name: Check HTML validity | |
| run: | | |
| if grep -q '<script' visualizer/index.html && grep -q '</html>' visualizer/index.html; then | |
| echo "index.html structure looks valid" | |
| else | |
| echo "index.html may be malformed" | |
| exit 1 | |
| fi |