Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
139 lines (104 loc) · 3.99 KB
/
Copy pathMakefile
File metadata and controls
139 lines (104 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.PHONY: build clean install bench bench-compat bench-scaling pressure-bench size-check ruby-test loc-check rfc-ids audit audit-rust audit-ruby audit-npm \
libyears libyears-rust libyears-ruby libyears-npm bump-homebrew bump-aur \
release-dry-run release-crates release-npm release-jsr release-rubygems release-distribution release-all \
release-github release-github-sync \
coverage coverage-rust mutants fuzz-build
HOMEBREW_TAP ?= $(abspath ../../amkisko/homebrew-tap)
VERSION ?= $(shell sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
TAG ?= v$(VERSION)
ROOT ?= ./prayers
SERVER ?=
SIGNING_KEY ?=
build:
cargo build --workspace
clean:
cargo clean
install:
cargo install --path crates/pray-cli --locked --force
ruby-test:
cd rubygems/pray-cli && bundle install && make test
# Soft warn at 150 LOC; hard fail above 300 unless ratcheted in scripts/loc-limits.allowlist.
loc-check:
./scripts/check-loc-limits.sh
rfc-ids:
cargo test -p pray-core --test rfc_ids
bench:
cargo bench -p pray-bench
bench-compat:
cargo run --release -q -p pray-bench --example compat_bench
ruby rubygems/pray-cli/benchmarks/compat_bench.rb
cd npmjs/pray-cli && npm run --silent build && node scripts/compat-bench.mjs
bench-scaling:
cargo test -p pray-bench -- --ignored --nocapture
# Load ladder across rust/ruby/npm + optional ceiling gate.
# Example: make pressure-bench PRESSURE_ARGS='--gate'
# Subset: PRAY_PRESSURE_IMPLS=rust make pressure-bench
PRESSURE_ARGS ?=
pressure-bench:
ruby scripts/pressure-bench.rb $(PRESSURE_ARGS)
size-check:
ruby scripts/check-package-sizes.rb
coverage: coverage-rust
coverage-rust:
cargo llvm-cov --workspace --summary-only --fail-under-lines 65
mutants:
cargo mutants -p pray-core --timeout 60 \
-f 'manifest.rs' -f 'package_spec.rs' -f 'dependency_graph.rs' \
-f 'resolve.rs' -f 'hashing.rs' -f 'package_integrity.rs' \
-f 'package_archive.rs' -f 'paths.rs'
fuzz-build:
cargo +nightly fuzz build --fuzz-dir fuzz
audit: audit-rust audit-ruby audit-npm
audit-rust:
cargo deny check advisories licenses bans sources
audit-ruby:
cd rubygems/pray-cli && bundle exec bundler-audit check --update
audit-npm:
cd npmjs/pray-cli && npm audit --omit=dev
libyears: libyears-rust libyears-ruby libyears-npm
libyears-rust:
cargo-libyear --sort libyear --top 10
libyears-ruby:
cd rubygems/pray-cli && bundle exec rake libyears
libyears-npm:
cd npmjs/pray-cli && npm run libyears
# Requires the GitHub tag to exist. Updates sibling amkisko/homebrew-tap.
bump-homebrew:
@test -n "$(VERSION)" || (echo "could not read version from Cargo.toml" >&2; exit 2)
$(HOMEBREW_TAP)/scripts/bump-formula.sh \
--formula pray \
--tag "$(TAG)" \
--repository kiskolabs/pray \
--commit
# Manual release helpers. Language registries default to dry-run / build-only.
# Use scripts/release/*.sh --publish (or make release-* with care) to push.
release-dry-run:
./scripts/release/all.sh --dry-run
release-crates:
./scripts/release/crates.sh --publish
release-npm:
./scripts/release/npm.sh --publish
release-jsr:
./scripts/release/jsr.sh --publish
release-rubygems:
./scripts/release/rubygems.sh --publish
# Requires GitHub tag v$(VERSION). Rewrites packaging/aur/pray-cli/PKGBUILD.
bump-aur:
./scripts/release/aur_bump.sh
release-distribution:
@args="--root $(ROOT)"; \
if [ -n "$(SERVER)" ]; then args="$$args --server $(SERVER)"; fi; \
if [ -n "$(SIGNING_KEY)" ]; then args="$$args --signing-key $(SIGNING_KEY)"; fi; \
./scripts/release/distribution.sh $$args
# After a successful full publish, wipe target/ so release and tooling artifacts do not accumulate.
release-all:
@args="--publish --root $(ROOT)"; \
if [ -n "$(SERVER)" ]; then args="$$args --server $(SERVER)"; fi; \
if [ -n "$(SIGNING_KEY)" ]; then args="$$args --signing-key $(SIGNING_KEY)"; fi; \
./scripts/release/all.sh $$args
$(MAKE) clean
# GitHub Release title is vX.Y.Z. Notes are that version's CHANGELOG.md section.
release-github:
./scripts/release/github.sh --publish
release-github-sync:
./scripts/release/github.sh --publish --all