diff --git a/.config/mise.toml b/.config/mise.toml index 8a77313..e52f235 100644 --- a/.config/mise.toml +++ b/.config/mise.toml @@ -111,16 +111,20 @@ act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:act-24.04 \ tools = { "cargo:cargo-nextest" = "latest" } description = "Run tests for a specific package or all packages" usage = """ - flag "--rust-log " env="RUST_LOG" - arg "[rest]" double_dash = "required" default="" help="Passed directly to `cargo nextest`. Use `mise test -- help` for nextest help." + arg "[rest]" default="r --workspace" help="Passed directly to `cargo nextest`" """ run = """ -if [ $usage_rust_log ]; then RUST_LOG=$usage_rust_log; fi -if [ -n "${usage_rest?}" ]; then - cargo nextest ${usage_rest?} -else - cargo nextest run --workspace -fi +cargo nextest ${usage_rest} +""" + +[tasks.coverage] +tools = { "cargo:cargo-llvm-cov" = "latest", "cargo:cargo-nextest" = "latest" } +description = "Get test coverage report." +usage = """ + arg "[rest]" default="--html --open" +""" +run = """ +RUSTFLAGS=-Zcodegen-backend=llvm cargo llvm-cov nextest --html --open """ # LOCAL ####################################################################### diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f65ed0a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# How to work on this project + +Thanks for your interest! + +You should have a few prerequisite tools installed. Most importantly, you'll +need [mise](https://mise.jdx.dev/), an environment manager and task runner. + +Once you install mise, run `mise install` and `mise run` to get all the +necessary tools and view the available actions. + +## Testing + +Tests are handled +with [cargo-nextest](https://github.com/nextest-rs/nextest). Test coverage is +generated with [cargo-llvm-cov.](https://github.com/taiki-e/cargo-llvm-cov) +Generally, tests should be built out using +[q_test_harness.](./crates/test_harness) Read that documentation to learn +common testing patterns. + +You can test CI locally by running `mise ci`. You can change which workflow and +which matrix parameters are set by using this sort of pattern: + +```mise ci -W ./.github/workflows/ci.yml --matrix target:x86_64-unknown-linux-gnu``` + +## PRs and Commit Messages + +PRs, when accepted, should be squashed into a single commit using [git +convention](https://www.conventionalcommits.org/en/v1.0.0/) for the message. +This is used to automatically generate changelogs when we publish. + +PRs are expected to follow best practices. If you author a PR using an LLM, +please disclose that you have done so. All CI checks should pass. + + +## Publishing + +Crates are published using +[cargo-smart-release.](https://github.com/crate-ci/cargo-release) Contributors +generally shouldn't be running this, so this documentation is mostly for me :p +Crates should have at least 80% test coverage before release. Currently there +are hooks to enforce this, so use your best judgement.