Add a docs workflow #494
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
# Make sure CI fails on all warnings, including Clippy lints | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo test --features default | |
# Check formatting with rustfmt | |
formatting: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Ensure rustfmt is installed and setup problem matcher | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Rustfmt Check | |
uses: actions-rust-lang/rustfmt@v1 | |
# Check warnings from clippy | |
clippy_check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Clippy | |
run: cargo clippy --all-targets --features default | |
build: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install FileCheck | |
run: sudo add-apt-repository universe && sudo apt-get update && sudo apt-get install llvm-15-tools && sudo ln -s /usr/bin/FileCheck-15 /usr/bin/FileCheck | |
- name: Build (debug) | |
run: cargo build --verbose | |
- name: Build (release) | |
run: cargo build --release --verbose | |
- name: Run integration tests | |
run: chmod +x bin/* && PATH=$PWD/target/release:$PWD/bin:$PATH python3 utils/test-runner.py tests -j 2 | |
speed: | |
name: Test Speed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Build (release) | |
run: cargo build --release --verbose | |
- name: Run integration tests (release, ) | |
run: echo "integration tests (release, )" >> $GITHUB_STEP_SUMMARY; (time cargo run --release --bin opt -- tests/lutlang/hard_examples.txt 2>>/dev/null) 2>> $GITHUB_STEP_SUMMARY | |
- name: Run integration tests (release, proof gen) | |
run: echo "integration tests (release, proof gen)" >> $GITHUB_STEP_SUMMARY; (time cargo run --release --bin opt -- tests/lutlang/hard_examples.txt --verbose 2>>/dev/null) 2>> $GITHUB_STEP_SUMMARY | |
- name: Run comparator (release, proof gen) | |
run: echo "comparator (release, proof gen)" >> $GITHUB_STEP_SUMMARY; (time cargo run --release --bin opt -- tests/lutlang/gate_compare.txt --verbose 2>>/dev/null) 2>> $GITHUB_STEP_SUMMARY | |
- name: Run comparator (release,) | |
run: echo "comparator (release,)" >> $GITHUB_STEP_SUMMARY; (time cargo run --release --bin opt -- tests/lutlang/gate_compare.txt 2>>/dev/null) 2>> $GITHUB_STEP_SUMMARY | |
- name: Run eqmap_fpga (release,) | |
run: echo "eqmap_fpga (release,)" >> $GITHUB_STEP_SUMMARY; (time cargo run --release --bin eqmap_fpga -- verilog/multPipe_n4.v --no-verify 1>>/dev/null 2>>/dev/null) 2>> $GITHUB_STEP_SUMMARY | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --features default --workspace --json > coverage.json | |
- name: Coverage (60% by line) | |
run: python3 utils/min-coverage.py -p 60.0 coverage.json --whitelist optcell.rs eqmap_asic.rs eqmap_fpga.rs opt.rs parse-verilog.rs emit-verilog.rs check.rs logic.rs driver.rs cost.rs >> $GITHUB_STEP_SUMMARY | |
- name: Coverage (80% by line) | |
run: python3 utils/min-coverage.py -p 80.0 coverage.json --whitelist optcell.rs eqmap_asic.rs asic.rs eqmap_fpga.rs opt.rs parse-verilog.rs emit-verilog.rs check.rs logic.rs driver.rs cost.rs >> $GITHUB_STEP_SUMMARY | |
mdformat: | |
name: Markdown format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Markdown check format | |
uses: ydah/mdformat-action@main | |
with: | |
number: true | |
pyformat: | |
name: Python format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Format python code | |
uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
src: "./utils" |