Merge remote-tracking branch 'origin/main' into codex/add-extraction-… #7062
Workflow file for this run
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: Unit tests | |
| on: [push] | |
| env: | |
| RUST_BACKTRACE: full | |
| jobs: | |
| unit-tests: | |
| name: "Unit Tests" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Install Packages" | |
| run: sudo apt-get install -y libmpfr6 libmpfr-dev | |
| - name: "Install Racket" | |
| uses: Bogdanp/[email protected] | |
| with: | |
| version: "8.14" | |
| - name: Install Rust compiler | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: actions/checkout@master | |
| - name: "Install dependencies" | |
| run: make install | |
| # SoftPosit is required to test the softposit platform we use for testing | |
| - name: "Install SoftPosit support" | |
| run: raco pkg install softposit-rkt | |
| - name: "Test raco fmt compliance" | |
| run: make fmt && git diff --exit-code | |
| # Run the Herbie unit tests | |
| - name: "Run Herbie unit tests" | |
| run: raco test src/ infra/ egg-herbie/ | |
| # Test the command-line tools | |
| - name: "Test the shell command-line tool" | |
| run: | | |
| <bench/tutorial.fpcore racket -l herbie shell >/tmp/out.fpcore | |
| test `grep -c :precision /tmp/out.fpcore` -eq 3 | |
| test `grep -c ';;' /tmp/out.fpcore` -eq 0 | |
| - name: "Test the improve command-line tool" | |
| run: | | |
| racket -l herbie improve bench/tutorial.fpcore /tmp/out.fpcore | |
| test `grep -c :precision /tmp/out.fpcore` -eq 3 | |
| test `grep -c '^; ' /tmp/out.fpcore` -eq 0 | |
| - name: "Run the report command-line tool" | |
| run: | | |
| racket -l herbie report bench/tutorial.fpcore /tmp/out/ | |
| test -d /tmp/out/ | |
| test -f /tmp/out/index.html | |
| test -f /tmp/out/results.json | |
| - name: "Run two reports with the same seed and diff them" | |
| run: | | |
| racket -l herbie report --threads yes --seed 1 bench/hamming/rearrangement.fpcore graphs0 | |
| racket -l herbie report --threads yes --seed 1 bench/hamming/rearrangement.fpcore graphs1 | |
| racket infra/diff.rkt graphs0 graphs1 | |
| - name: "Run Herbie with egglog" | |
| run: racket -l herbie report --timeout 600 +o generate:egglog --seed 1 bench/hamming/trigonometry.fpcore graphs2 | |
| # Test the egg-herbie Rust code | |
| - run: cd egg-herbie && cargo clippy --tests | |
| continue-on-error: true | |
| - run: cd egg-herbie && cargo test | |
| - run: cd egg-herbie && cargo fmt -- --check | |
| - run: cd egg-herbie && raco test ./ | |
| # Test the API | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: "Test the endpoint" | |
| run: node infra/test-api.mjs |