This is an experiment in creating usable SDF renders for bevy - including in a WebGL context, or in older devices.
- Use doc tests aggressively to show how APIs should be used.
You can use
#
to hide a setup line from the doc tests. - Unit test belong near the code they are testing. Use
#[cfg(test)]
on the test module to ignore it during builds, and#[test]
on the test functions to ensure they are run. - Integration tests should be stored in the top level
tests
folder, importing functions fromlib.rs
.
Use cargo test
to run all tests.
The CI will:
- Ensure the code is formatted with
cargo fmt
. - Ensure that the code compiles.
- Ensure that (almost) all
clippy
lints pass. - Ensure all tests pass on Windows, MacOS and Ubuntu.
Check this locally with:
cargo run -p ci
cargo test --workspace
To manually rerun CI:
- Navigate to the
Actions
tab. - Use the dropdown menu in the CI run of interest and select "View workflow file".
- In the top-right corner, select "Rerun workflow".
Reference documentation is handled with standard Rust doc strings.
Use cargo doc --open
to build and then open the docs.
Design docs (or other book-format documentation) is handled with mdBook.
Install it with cargo install mdbook
, then use mdbook serve --open
to launch the docs.
To run the benchmarks, use cargo bench
.
For more documentation on making your own benchmarks, check out criterion's docs.