a very dirty, but works #4301
Workflow file for this run
This file contains 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.12" | |
- 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 | |
- 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 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 | |
- name: "Start server" | |
run: racket -l herbie web --port 8000 & | |
- name: "Wait for server startup" | |
run: while ! nc -z localhost 8000; do sleep 0.1; done | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "Test the endpoint" | |
run: node infra/testApi.mjs |