Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
99 lines (79 loc) · 4.25 KB
/
Copy pathJustfile
File metadata and controls
99 lines (79 loc) · 4.25 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
# Clutch: one command each for setup, for the checks that CI runs, and for the generated
# files (ADR 012). Run `just <recipe>`. Without just installed:
# uvx --from rust-just==1.58.0 just <recipe>
# The mainnet recipes of the dry-run kit are in mainnet.just, which this file never loads.
set dotenv-load
py := "uv run --quiet --with pyyaml==6.0.2 python"
browser := "uv run --quiet --with pyyaml==6.0.2 --with playwright==1.63.0 --with axe-playwright-python==0.1.8 python"
# List the recipes
default:
@{{just_executable()}} --list --justfile {{justfile()}}
# Install what the checks need: forge-std, the policy's packages and a headless Chromium
setup:
git submodule update --init --depth 1
cd policy/constellation && bun install --frozen-lockfile --ignore-scripts
uv run --quiet --with playwright==1.63.0 python -m playwright install --only-shell chromium
forge build
@echo "Ready. The fork suite also needs RPC=<archive mainnet RPC> in .env, which git ignores."
# Print the versions of the tools that the checks use
doctor:
@uv --version
@echo "bun $(bun --version) (CI pins 1.3.0)"
@forge --version | head -1
@git --version
# Rebuild every generated file: the policy artifact, the log, the status register and the guide
regen: policy-compile
{{py}} scripts/build_log.py
{{py}} scripts/validate_docs.py --write-status
{{py}} scripts/build_onboarding.py
# Run every check that CI runs, except the fork suite
check: check-docs check-policy check-browser check-workflows
# The docs bundle, the generated files, the repository checks and their tests
check-docs:
{{py}} scripts/validate_docs.py
{{py}} scripts/validate_docs.py --check-status
{{py}} scripts/test_validate_docs.py
{{py}} scripts/build_log.py --check
{{py}} scripts/build_onboarding.py --check
{{py}} scripts/test_build_onboarding.py
{{py}} scripts/check_redaction.py
{{py}} scripts/check_licences.py
{{py}} scripts/check_invariants.py
{{py}} scripts/test_checks.py
# The policy artifacts equal a fresh compile; the compiler's tests; the type check
check-policy:
cd policy/constellation && bun install --frozen-lockfile --ignore-scripts && bun compiler/compile.ts --manifest manifests/fork-25946643.json --check && bun compiler/compile.ts --manifest manifests/rehearsal-26249900.json --check && bun test compiler && ./node_modules/.bin/tsc --noEmit -p .
# Every control of the onboarding guide, in headless Chromium
check-browser:
{{browser}} scripts/test_onboarding_page.py
# The workflows: actionlint and zizmor, offline
check-workflows:
uvx --from actionlint-py==1.7.12.25 actionlint .github/workflows/*.yml
uvx zizmor==1.30.1 --offline .github/workflows
# The guide's items whose content or sources changed since their pins, with each source's change
stale:
{{py}} scripts/build_onboarding.py --stale
# After a review, pin guide items again: just repin actor:asset-safe flow:topup
repin +items:
{{py}} scripts/build_onboarding.py --repin {{items}}
# Every outside link of the committed guide, through the GitHub API (weekly in CI)
links:
{{py}} scripts/check_links.py
# The fork suite on the pinned mainnet fork; needs RPC (no keys)
test-fork:
RPC=${RPC} forge test -vvv
# Add a log entry dated now, and rebuild the log. KIND: Decision, Evidence, Import, Initialization or Update
log kind text:
{{py}} scripts/build_log.py --new {{quote(kind)}} {{quote(text)}}
# Record a human's own verification of a page, with the hash of its body. Humans only (CONTRIBUTING.md)
verify page by *flags:
{{py}} scripts/verify_page.py {{quote(page)}} --by {{quote(by)}} {{flags}}
# Compile the contracts and scripts
build:
forge build
# Policy (ADR 004): compile the constellation into the committed fork artifact and the enabling-vote rehearsal's artifact
policy-compile:
cd policy/constellation && bun install --frozen-lockfile --ignore-scripts && bun compiler/compile.ts --manifest manifests/fork-25946643.json && bun compiler/compile.ts --manifest manifests/rehearsal-26249900.json
# Policy: fail if a committed artifact differs from a fresh compile; run the compiler tests
policy-check:
cd policy/constellation && bun install --frozen-lockfile --ignore-scripts && bun compiler/compile.ts --manifest manifests/fork-25946643.json --check && bun compiler/compile.ts --manifest manifests/rehearsal-26249900.json --check && bun test compiler