version: '3'
vars:
DOMAIN: '{{ .DOMAIN | default "tests/fixtures/translated/gripper-costs/domain.pddl" }}'
PROBLEM: '{{ .PROBLEM | default "tests/fixtures/translated/gripper-costs/problem.pddl" }}'
SAS_FILE: '{{ .SAS_FILE | default "target/ground/output.sas" }}'
tasks:
default:
cmds:
- task --list --sort=none
silent: true
ground:
desc: Ground PDDL into output.sas with Fast Downward's translator (Docker)
preconditions:
- sh: command -v docker
msg: "docker not found — install from https://docker.com"
- sh: docker info >/dev/null 2>&1
msg: "docker daemon not running — start Docker Desktop or dockerd"
sources: ['{{.DOMAIN}}', '{{.PROBLEM}}']
generates: ['{{.SAS_FILE}}']
cmds:
- mkdir -p "$(dirname '{{.SAS_FILE}}')"
- >-
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/work" -w /work
aibasel/downward@sha256:328732c5cb87e8c34f477a88a4f99977b6ea91ca5c1e859b886b5334c42d80e8 --sas-file '{{.SAS_FILE}}'
--translate '{{.DOMAIN}}' '{{.PROBLEM}}'
ground:load:
desc: Ground PDDL, then load output.sas in Rust and print its optimal cost
deps: [ground]
cmds:
- cargo run --quiet --example load -- '{{.SAS_FILE}}'
fmt:
desc: Check formatting
cmds:
- cargo fmt --all --check
lint:
desc: Run clippy
cmds:
- cargo clippy --all-targets --all-features -- -D warnings
test:
desc: Run the test suite
cmds:
- cargo test --all-features {{.CLI_ARGS}}
bench:
desc: Run the benchmarks (parsing, projections, perfect heuristic)
cmds:
- cargo bench --bench construction {{.CLI_ARGS}}
fuzz:
desc: Fuzz the output.sas reader (needs nightly and cargo-fuzz); default 5 minutes
dir: fuzz
preconditions:
- sh: cargo +nightly fuzz --version >/dev/null 2>&1
msg: "cargo-fuzz missing — cargo install cargo-fuzz; rustup toolchain install nightly"
cmds:
- mkdir -p corpus/parse
- for f in ../tests/fixtures/*/output.sas ../tests/fixtures/translated/*/output.sas; do cp "$f" "corpus/parse/$(basename "$(dirname "$f")").sas"; done
- cargo +nightly fuzz run parse corpus/parse -- -max_total_time={{.SECONDS | default 300}} -max_len=8192
build:no-std:
desc: Build the library for a bare-metal target without std
preconditions:
- sh: rustup target list --installed | grep -q thumbv7em-none-eabihf
msg: "target missing — rustup target add thumbv7em-none-eabihf"
cmds:
- cargo build --lib --target thumbv7em-none-eabihf
- cargo build --lib --target thumbv7em-none-eabihf --no-default-features
- cargo build --lib --target thumbv7em-none-eabihf --all-features
build:msrv:
desc: Build the library with the minimum supported Rust version (1.85)
preconditions:
- sh: rustup run 1.85 rustc --version >/dev/null 2>&1
msg: "Rust 1.85 missing — rustup toolchain install 1.85"
cmds:
- cargo +1.85 build --lib --all-features
ci:
desc: Run what CI runs
cmds:
- task: fmt
- task: lint
- task: test
- task: build:no-std
- task: build:msrv