en/.justfile
jutty 419b812044
Some checks are pending
/ verify (push) Waiting to run
Merge ci-testing: publish to GJD registry on tag push
commit d6fa2986ec
Author: jutty <j@jutty.dev>
Date:   Sun Mar 1 03:18:50 2026 -0300

    Add tag and push-unsafe recipes to justfile

commit 6a239e1708
Author: jutty <j@jutty.dev>
Date:   Sun Mar 1 03:18:21 2026 -0300

    Update roadmap

commit a3da368573
Author: jutty <j@jutty.dev>
Date:   Thu Feb 26 20:56:48 2026 -0300

    Cleanup CI testing files

commit b56f53bdc2
Author: jutty <j@jutty.dev>
Date:   Thu Feb 26 20:17:10 2026 -0300

    CI: Adjust curl logging, add a job for internal networking tests

commit 435e478b01
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 02:35:20 2026 -0300

    CI: Move sha256sum calculation before registry upload

commit 727ea16769
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 01:51:05 2026 -0300

    CI: Add curl -f fail flag to extra tools binary fetching

commit 2ff7a6cf1b
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 01:48:00 2026 -0300

    CI: Make additional tooling move to /usr/local/bin verbose

commit bf88f86bce
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 01:40:32 2026 -0300

    CI: Adapt to cargo-audit outlier URL structure

commit 291081359e
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 01:29:13 2026 -0300

    CI: Deduplicate additional tool fetching

    While this moves the source of truth for CI tooling versions to
    somewhere outside the workflow definitions, it also avoids duplication
    and keeps debug (check.yaml) and production (publish.yaml) verifications
    fully independent.

commit 7d2a234fc3
Author: jutty <j@jutty.dev>
Date:   Wed Feb 25 00:32:51 2026 -0300

    Add cargo-audit security assessment

commit ed30ee7b75
Author: jutty <j@jutty.dev>
Date:   Thu Feb 19 02:06:42 2026 -0300

    CI: Add wildcard branch to check workflow
2026-03-01 04:38:26 -03:00

352 lines
7.7 KiB
Makefile

# DEVELOP
# Update dependencies
[group: 'develop']
update:
cargo update --verbose
# Build and serve
[group: 'develop']
run host='::1' port='3003' *args:
DEBUG=${DEBUG:-debug} {{ debug_vars }} cargo run -- \
--hostname {{ host }} --port {{ port }} {{ args }}
alias r := run
# Build and serve on changes
[group: 'develop']
run-watch:
@{{ watch_cmd }} {{ just_cmd }} run
alias w := run-watch
[private]
quick-assess:
{{ just_cmd }} lint check quick-test-cover
[private]
quick-assess-run:
-{{ just_cmd }} quick-assess
{{ just_cmd }} run
# Run quick assessments on changes
[group: 'develop']
quick-assess-watch:
{{ watch_cmd }} {{ just_cmd }} quick-assess
alias qa := quick-assess-watch
# Run quick assessments, build and serve on changes
[group: 'develop']
quick-assess-run-watch:
{{ watch_cmd }} {{ just_cmd }} quick-assess-run
alias qr := quick-assess-run-watch
[private]
quick-test-cover:
{{ cover_cmd }} --no-report -- --test 'serial_tests::' --test-threads 1
{{ cover_cmd }} --no-report -- --skip 'serial_tests::'
{{ cover_cmd }} report --html
@{{ cover_cmd }} report | tail -1 | awk '{ print " [ Regions:", $4, "• Functions:", $7, "• Lines:", $10, "]" }'
# Quickly update coverage reports (inaccurate)
[group: 'assess']
quick-test-cover-watch:
{{ watch_cmd }} {{ just_cmd }} quick-test-cover
alias qo := quick-test-cover-watch
# Format all files
[group: 'develop']
format:
cargo +nightly fmt
alias f := format
# Lint
[group: 'develop']
lint:
cargo +nightly clippy
alias l := lint
# Lint on changes
[group: 'develop']
lint-watch:
{{ watch_cmd }} {{ just_cmd }} lint
alias lw := lint-watch
# Run cargo check on changes
[group: 'develop']
check-watch:
RUSTFLAGS="-Dwarnings" {{ watch_cmd }} {{ just_cmd }} check
alias cw := check-watch
# Apply rustc lint fixes
[group: 'develop']
rustc-fix:
cargo fix --allow-dirty
alias rf := rustc-fix
# Apply clippy lint fixes
[group: 'develop']
clippy-fix:
cargo +nightly clippy --fix --allow-dirty
alias cf := clippy-fix
# Apply all automatic fixes
[group: 'develop']
fix: rustc-fix clippy-fix format
alias x := fix
# Run tests on changes
[group: 'develop']
test-watch:
{{ watch_cmd }} {{ just_cmd }} test
alias tw := test-watch
# Run tests with coverage report on changes
[group: 'develop']
cover-watch:
{{ watch_cmd }} {{ just_cmd }} cover-report
alias ow := cover-watch
# Make coverage report
[group: 'develop']
cover-report: test-cover
{{ cover_cmd }} report --html
{{ cover_cmd }} report
alias or := cover-report
# Open coverage report
[group: 'develop']
cover-open:
{{ cover_cmd }} report --open
alias oo := cover-open
# Tag HEAD with version from Cargo.toml
[script, group: 'assess']
tag: update && version-assess
last_tag=$(git describe --tags --abbrev=0 \
$(git rev-list --tags --max-count=1) | tr -d v)
manifest_version=$(grep '^version' Cargo.toml | cut -d \" -f 2)
lockfile_version=$(grep -A 1 'name = "en"' Cargo.lock |
grep version | cut -d '"' -f 2)
if [ "$last_tag" = "$manifest_version" ]; then
echo "Last tag $last_tag and manifest ($manifest_version) already match"
exit 1
elif [ "$manifest_version" != "$lockfile_version" ]; then
echo "Manifest and lockfile versions don't match: update failed?"
exit 1
fi
git tag "v$manifest_version" HEAD
# Verify and push
[group: 'develop']
push: verify
git push
git push --tags
alias p := push
# Push without verifying
[group: 'develop']
push-unsafe:
git push --no-verify
git push --tags --no-verify
alias pu := push-unsafe
# DOCUMENT
# Generate crate documentation
[group: 'document']
doc:
cargo doc --document-private-items --no-deps
alias d := doc
# Generate crate and dependencies documentation
[group: 'document']
doc-all:
cargo doc --document-private-items
alias da := doc-all
# Open documentation
[group: 'document']
doc-open: doc
xdg-open target/doc/en/index.html
alias do := doc-open
# ASSESSMENTS
# Assess formatting
[group: 'assess']
format-assess:
cargo +nightly fmt -- --check
alias fc := format-assess
# Assess production lints
[group: 'assess']
lint-assess:
cargo +nightly clippy -- \
-D clippy::dbg_macro -D clippy::use_debug \
-D clippy::print_stdout -D clippy::print_stderr \
-D clippy::todo -D clippy::unimplemented -D clippy::unreachable
alias la := lint-assess
# Run cargo check
[group: 'assess']
check:
{{ debug_vars }} cargo check --workspace
alias c := check
# Run tests
[group: 'assess']
test:
cargo test -- --test 'serial_tests::' --test-threads 1
cargo test --bin en
cargo test --doc
cargo test --lib -- --skip 'serial_tests::'
alias t := test
# Clean test coverage data
[group: 'assess']
test-cover-clean:
{{ cover_cmd }} clean
alias oc := test-cover-clean
# Run tests with coverage
[group: 'assess']
test-cover: test-cover-clean
{{ cover_cmd }} --no-report -- --test 'serial_tests::' --test-threads 1
{{ cover_cmd }} --no-report -- --skip 'serial_tests::'
alias o := test-cover
# Assess coverage
[group: 'assess']
cover-assess: test-cover
{{ cover_cmd }} --fail-under-regions 95 report
alias oa := cover-assess
# Run all assessments
[script, group: 'assess']
verify:
export RUSTFLAGS=${RUSTFLAGS:-"-Dwarnings"}
if [ -n "$(git status --porcelain)" ]; then
echo "Git working tree is dirty: Commit or stash your changes first"
git status
exit 1
fi
{{ just_cmd }} update version-assess \
security-assess format-assess lint-assess check test cover-assess
alias v := verify
# Check tag-manifest consistency
[script, group: 'assess']
version-assess: update
last_tag=$(git describe --tags --abbrev=0 \
$(git rev-list --tags --max-count=1) | tr -d v)
manifest_version=$(grep '^version' Cargo.toml | cut -d \" -f 2)
lockfile_version=$(grep -A 1 'name = "en"' Cargo.lock |
grep version | cut -d '"' -f 2)
if
[ "$last_tag" != "$manifest_version" ] ||
[ "$last_tag" != "$lockfile_version" ]
then
printf 'Last tag: %s\nManifest: %s\nLockfile: %s\n' \
"$last_tag" "$manifest_version" "$lockfile_version"
exit 1
fi
alias va := version-assess
# Audit security advisories
security-assess:
cargo audit --deny warnings
alias sa := security-assess
# BUILD
# Cleanup build artifacts
[group: 'build']
clean:
cargo clean
alias cl := clean
# Build project with Cargo
[group: 'build']
build: update
cargo build
alias b := build
# Release build
[group: 'build']
release-build: update verify
cargo build --release
alias rb := release-build
# Clean, run assessments, release build
[group: 'build']
full-build: clean release-build
alias fb := full-build
# Upload release build to git.jutty.dev package registry
[script, group: 'build']
upload: full-build && shasum
version=$(./target/release/en --version)
api_root=https://git.jutty.dev/api/
url=$api_root/packages/jutty/generic/en/$version/en-x86_64-linux-gnu
file=target/release/en
curl -fsSL \
--user jutty:$(secret-tool lookup Title gjd-registry-token) \
--upload-file $file $url
alias u := upload
# Print sha256sum for CI logging
[group: 'build']
shasum:
sha256sum target/release/en
## META
[default, private]
default:
@just --list --unsorted --justfile {{justfile()}}
export CARGO_TERM_COLOR := 'always'
debug_vars := 'DEBUG=${DEBUG:-} DEBUG_FILTER=${DEBUG_FILTER:-} RUST_BACKTRACE=${RUST_BACKTRACE:-} RUSTFLAGS=${RUSTFLAGS:-}'
watch_cmd := "watchexec -qc -r -e rs,toml,html --color always -- "
cover_cmd := 'cargo llvm-cov --color always --ignore-filename-regex "main\.rs|log\.rs"'
just_cmd := 'just --timestamp --explain --command-color green'
set unstable