-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
160 lines (134 loc) · 3.77 KB
/
Copy pathjustfile
File metadata and controls
160 lines (134 loc) · 3.77 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Build
# Build the Swift package
build:
swift build
# Clean build artifacts
clean:
swift package clean
# Test
# Run Swift tests
test:
swift test
# Run tests with code coverage
test-cov:
swift test --enable-code-coverage
# Lint
# fleet:block audit
audit:
zizmor --persona auditor .github/workflows/
# fleet:end
# Run SwiftLint
lint:
swiftlint --strict
# Validate JSON data files
lint-json:
python3 scripts/lint-json.py
# Test repository scripts
test-scripts:
python3 -m unittest discover -s scripts/tests
# Scan for unused code. native build system (deprecated): swiftbuild emits no index store Periphery can find.
periphery:
swift build --build-tests --build-system native
periphery scan --skip-build --index-store-path "$(find .build -path '*/debug/index/store' -type d | head -1)"
# Check for typos
typos:
typos
# Site
# Build the site
site-build:
cd site && npm run build
# Start the site dev server
site-dev:
cd site && npm run dev
# Run site unit tests
site-test:
cd site && npm test
# Format site files with Prettier
site-format:
cd site && npm run format
# Check site formatting
site-format-check:
cd site && npm run format:check
# Install site dependencies
site-install:
cd site && npm ci --strict-allow-scripts
# fleet:block npm-policy
# Verify every dependency install script is denied or exactly approved
npm-policy:
node scripts/check-npm-install-policy.mjs site
# fleet:end
# Preview the built site
site-preview:
cd site && npm run preview
# Check for broken links in the built site and README
lychee: site-build
cd site && lychee --config ../lychee.toml --root-dir "$(pwd)/dist/client" 'dist/client/**/*.html' ../README.md
# Check
# Run all checks
check:
#!/usr/bin/env bash
set -euo pipefail
failed=0
skipped=()
run() {
echo "--- $1 ---"
if ! "$@"; then
failed=1
fi
}
skip() {
echo "--- $1 --- skipped ($2 not found)"
skipped+=("$2 (brew install $3)")
}
run node scripts/check-npm-install-policy.mjs site
if command -v swiftlint &>/dev/null; then
run swiftlint --strict
else
skip lint swiftlint swiftlint
fi
run python3 scripts/lint-json.py
run python3 -m unittest discover -s scripts/tests
if command -v typos &>/dev/null; then
run typos
else
skip typos typos typos-cli
fi
if command -v zizmor &>/dev/null; then
run zizmor --persona auditor .github/workflows/
else
skip audit zizmor zizmor
fi
if command -v periphery &>/dev/null; then
# native build system (deprecated): swiftbuild emits no index store Periphery can find
run swift build --build-tests --build-system native
run periphery scan --strict --disable-update-check --skip-build --index-store-path "$(find .build -path '*/debug/index/store' -type d | head -1)"
else
skip periphery periphery periphery
fi
run swift test
echo "--- site-format-check ---"
(cd site && npm run format:check) || failed=1
echo "--- site-test ---"
(cd site && npm test) || failed=1
echo "--- site-build ---"
(cd site && npm run build) || failed=1
echo "--- site-deploy-dry ---"
(cd site && WRANGLER_SEND_METRICS=false npm run deploy:dry) || failed=1
if [ ${#skipped[@]} -gt 0 ]; then
echo ""
echo "Checks skipped due to missing tools:"
for tool in "${skipped[@]}"; do
echo " - $tool"
done
failed=1
fi
exit $failed
# fleet:block install-hooks
# Install git hooks (AI trailer guard + DCO sign-off + pre-push checks). Run once per clone.
install-hooks:
git config core.hooksPath .githooks
# fleet:end
# fleet:block pinprick-audit
pinprick-audit:
pinprick audit .
# fleet:end