Skip to content

Symbolic growth, exact Pareto path search, and deterministic solver backends #1792

Symbolic growth, exact Pareto path search, and deterministic solver backends

Symbolic growth, exact Pareto path search, and deterministic solver backends #1792

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# Cancel superseded runs on the same ref (e.g. rapid pushes to a PR).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Least privilege: jobs only read the repo; codecov auth is via token secret.
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Incremental compilation hurts cold CI builds and bloats the cache; disable it
# (recommended by Swatinem/rust-cache).
CARGO_INCREMENTAL: 0
# Tolerate transient registry/network blips.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
# Formatting — cheap, fails fast, no build/cache needed.
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check
# Lints.
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-targets --features ilp-highs -- -D warnings
# Cross-compile the portable Rust surface to RISC-V Linux, then execute the
# CLI under QEMU user-mode emulation to verify runtime behavior (not just
# that the binary links).
riscv:
name: RISC-V build & run
runs-on: ubuntu-latest
env:
FEATURES: "ilp-lp-solvers"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: riscv64gc-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- name: Install RISC-V cross tools and QEMU
run: |
sudo apt-get update
sudo apt-get install -y gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu qemu-user
- name: Build workspace for RISC-V
env:
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc
run: cargo build --workspace --no-default-features --features "$FEATURES" --target riscv64gc-unknown-linux-gnu
- name: Verify RISC-V executable
run: |
riscv64-linux-gnu-readelf -h target/riscv64gc-unknown-linux-gnu/debug/pred \
| grep 'Machine:.*RISC-V'
- name: Run CLI smoke test under QEMU
env:
PRED: qemu-riscv64 -L /usr/riscv64-linux-gnu target/riscv64gc-unknown-linux-gnu/debug/pred
run: |
# Registry loads and the catalog renders on RISC-V.
$PRED list | head -5
# End-to-end create + brute-force solve: MIS of a 5-cycle is 2.
$PRED create MaximumIndependentSet --graph 0-1,1-2,2-3,3-4,4-0 -o mis.json
$PRED solve mis.json --solver brute-force | tee solve.out
grep -q '"evaluation": "Max(2)"' solve.out
# Build, test (nextest), doc tests, and paper.
test:
name: Test
runs-on: ubuntu-latest
# Single feature set across compile + test + doctest so artifacts are reused
# (no redundant full recompile between steps).
env:
FEATURES: "ilp-highs example-db"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@v2
with:
tool: nextest
- uses: Swatinem/rust-cache@v2
- name: Install typst
uses: typst-community/setup-typst@v5
- name: Compile tests
run: cargo nextest run --no-run --workspace --features "$FEATURES"
# The subprocess example tests (tests/suites/examples.rs) shell out to
# `cargo run --example … --features ilp-highs`. Pre-build those example
# binaries with that exact feature set so the subprocess reuses artifacts
# instead of recompiling the whole crate mid-test (which otherwise adds
# 60s+ to a single test's wall-clock and would trip the nextest timeout).
- name: Build examples (for subprocess tests)
run: cargo build --examples --features ilp-highs
- name: Run tests
run: cargo nextest run --workspace --features "$FEATURES"
# nextest does not run doc tests; run them separately (reuses the build).
- name: Run doc tests
run: cargo test --doc --features "$FEATURES" --verbose
- name: Build paper
run: make paper
# Coverage. Feature set intentionally matches the historical coverage gate
# (ilp-highs only) to keep the codecov baseline stable.
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,nextest
- uses: Swatinem/rust-cache@v2
- name: Generate coverage
run: cargo llvm-cov nextest --features ilp-highs --workspace --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: false # Don't fail CI if upload fails
token: ${{ secrets.CODECOV_TOKEN }}