Skip to content

Commit

Permalink
feat: Justfile (#16)
Browse files Browse the repository at this point in the history
**Description**

Defines Justfile targets that cover CI checks.
  • Loading branch information
refcell authored Aug 23, 2024
1 parent 187c835 commit 43b6373
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 43b6373

Please sign in to comment.