From b5c6a08d5022a0143460b1ce1ecc16d5c1a757b4 Mon Sep 17 00:00:00 2001 From: refcell Date: Fri, 23 Aug 2024 10:23:10 -0400 Subject: [PATCH] feat: justfile --- .github/workflows/unit.yml | 29 ++++++++++++++--------------- Justfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 Justfile diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index d0829ef..fbe2d81 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -36,21 +36,20 @@ jobs: --workspace \ -E "kind(lib) | kind(bin) | kind(proc-macro)" - # re-add when we have library targets - # doc: - # name: doc tests - # env: - # RUST_BACKTRACE: 1 - # timeout-minutes: 30 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: dtolnay/rust-toolchain@stable - # - uses: Swatinem/rust-cache@v2 - # with: - # cache-on-failure: true - # - name: Run doctests - # run: cargo test --doc --workspace + doc: + name: doc tests + env: + RUST_BACKTRACE: 1 + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Run doctests + run: cargo test --doc --workspace unit-success: name: unit success diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..ff0f425 --- /dev/null +++ b/Justfile @@ -0,0 +1,31 @@ +set positional-arguments +alias t := test +alias d := doc +alias l := lint +alias f := fmt +alias b := build + +# default recipe to display help information +default: + @just --list + +# Test with all features +test: + cargo nextest run --locked --workspace -E "kind(lib) | kind(bin) | kind(proc-macro)" + +# Test docs +doc: + cargo test --locked --workspace --doc + +# Lint +lint: + cargo clippy --workspace --examples --tests --benches --all-features \ + && cargo hack check + +# Format +fmt: + cargo +nightly fmt --all && cargo +nightly fmt --all --check + +# Build +build: + cargo build --workspace --all-features