Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (69 loc) · 3.15 KB
/
Copy pathMakefile
File metadata and controls
85 lines (69 loc) · 3.15 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
# Use the same archive recipe as CI. Requires a git checkout because release
# archives omit .github/.
.PHONY: release_source_archive
release_source_archive:
.github/workflows/pack_release_archive.sh archives/release.tar.gz
# Output: bazel-bin/release/bazel-diff-rust-<os>-<arch>[.exe].
.PHONY: release_rust_binary
release_rust_binary:
bazel build //release:bazel-diff-rust --config=release
# Cross-compile static musl releases from Linux or Apple Silicon macOS.
.PHONY: release_rust_binary_linux
release_rust_binary_linux:
bazel build //release:bazel-diff-rust --config=release-linux
.PHONY: release_rust_binary_linux_arm64
release_rust_binary_linux_arm64:
bazel build //release:bazel-diff-rust --config=release-linux-arm64
.PHONY: build
build:
bazel build //:bazel-diff -c opt
# Use the pinned rustfmt for the root crate and tools/coverage.
.PHONY: format
format:
bazel run //tools/format:rustfmt
# Regenerate targets after adding, renaming, or removing tests under tests/e2e/.
# Commit the result; CI checks generated targets. See tools/e2e/README.md.
.PHONY: regen-e2e
regen-e2e:
bazel run //tools/e2e:regen
# Check generated e2e targets without rewriting them.
.PHONY: regen-e2e-check
regen-e2e-check:
bazel test //tools/e2e:regen_check //tools/e2e:split_e2e_tests_test
.PHONY: generate-readme
generate-readme:
bazel run //tools:generate-readme
# Prove a changeset's effect on bazel-diff's CPU and memory: builds base and candidate, runs both
# on synthetic workspaces of several sizes, interleaved, and writes perf-proof-summary.md +
# perf-proof-metrics.json. Attach the summary to the PR. Defaults compare HEAD with its
# merge-base on master; pass flags through PERF_PROOF_ARGS, e.g.
# make perf-proof PERF_PROOF_ARGS="--candidate WORKTREE --workload medium --iterations 8"
# Not `bazel run`: the harness itself invokes `bazel build`. See tools/perf/README.md.
.PHONY: perf-proof
perf-proof:
python3 tools/perf/perf_proof.py $(PERF_PROOF_ARGS)
# Smoke profile of the same harness (tiny workload, 2 iterations): checks the setup, proves nothing.
.PHONY: perf-proof-quick
perf-proof-quick:
python3 tools/perf/perf_proof.py --quick $(PERF_PROOF_ARGS)
.PHONY: perf-proof-test
perf-proof-test:
bazel test //tools/perf:perf_proof_test
COVERAGE_TARGETS = //src:cli_tests //src:rust_tests //tools:coverage_check_test //tools/coverage/... //tools/go/...
.PHONY: coverage
coverage:
bazel coverage --combined_report=lcov $(COVERAGE_TARGETS)
bazel run //tools:coverage-check -- bazel-out/_coverage/_coverage_report.dat
bazel run //tools:coverage-check -- --include tools/go/ --threshold 90 bazel-out/_coverage/_coverage_report.dat
.PHONY: coverage-check
coverage-check:
bazel run //tools:coverage-check -- bazel-out/_coverage/_coverage_report.dat
bazel run //tools:coverage-check -- --include tools/go/ --threshold 90 bazel-out/_coverage/_coverage_report.dat
.PHONY: coverage-test
coverage-test:
bazel test //tools:coverage_check_test
.PHONY: coverage-html
coverage-html:
bazel coverage --combined_report=lcov $(COVERAGE_TARGETS)
bazel run //tools:coverage-check -- bazel-out/_coverage/_coverage_report.dat --html coverage-html
@echo "Open coverage-html/index.html in a browser to inspect."