-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
87 lines (79 loc) · 2.84 KB
/
Copy pathjustfile
File metadata and controls
87 lines (79 loc) · 2.84 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
# Check
# Run all checks
check:
#!/usr/bin/env bash
set -euo pipefail
failed=0
skipped=()
run() {
echo "--- $1 ---"
shift
if ! "$@"; then
failed=1
fi
}
skip() {
echo "--- $1 --- skipped ($2)"
skipped+=("$2; install with: $3")
}
run diff git diff --check
if ! command -v bundle &>/dev/null; then
skip fleet-bundle "bundle not found" "brew install ruby"
elif ! BUNDLE_GEMFILE=fleet/Gemfile bundle check &>/dev/null; then
skip fleet-bundle "fleet bundle not installed" "BUNDLE_GEMFILE=fleet/Gemfile bundle install"
else
run tests env BUNDLE_GEMFILE=fleet/Gemfile bundle exec ruby -e 'Dir["fleet/test/*_test.rb"].sort.each { |file| require File.expand_path(file) }'
run rubocop env BUNDLE_GEMFILE=fleet/Gemfile bundle exec rubocop --config fleet/.rubocop.yml --cache false fleet/
fi
if command -v actionlint &>/dev/null; then
run actionlint actionlint -ignore 'reusable workflow call "\$/\.github/workflows/(reusable-conventional-commits|fleet-validate|reusable-zizmor)\.yml"'
else
skip actionlint "actionlint not found" "brew install actionlint"
fi
if command -v zizmor &>/dev/null; then
run audit zizmor --persona auditor .github/workflows/
else
skip audit "zizmor not found" "brew install zizmor"
fi
if command -v pinprick &>/dev/null; then
run pinprick-audit pinprick audit .
else
skip pinprick-audit "pinprick not found" "brew install pinprick"
fi
if command -v lychee &>/dev/null; then
run lychee lychee --config lychee.toml README.md profile/README.md CONTRIBUTING.md SECURITY.md
else
skip lychee "lychee not found" "brew install lychee"
fi
if [ ${#skipped[@]} -gt 0 ]; then
echo ""
echo "Checks skipped:"
for tool in "${skipped[@]}"; do
echo " - $tool"
done
failed=1
fi
exit "$failed"
# Lint the fleet renderer
rubocop:
BUNDLE_GEMFILE=fleet/Gemfile bundle exec rubocop --config fleet/.rubocop.yml --cache false fleet/
# Run the fleet test suites (commit-msg hook, guard regressions, conclusion contract, golden renders)
tests:
BUNDLE_GEMFILE=fleet/Gemfile bundle exec ruby -e 'Dir["fleet/test/*_test.rb"].sort.each { |file| require File.expand_path(file) }'
# fleet:block audit
audit:
zizmor --persona auditor .github/workflows/
# fleet:end
# fleet:block pinprick-audit
pinprick-audit:
pinprick audit .
# fleet:end
# Check README, profile, and community-health links
lychee:
lychee --config lychee.toml README.md profile/README.md CONTRIBUTING.md SECURITY.md
# Setup
# 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