-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.76 KB
/
ci.yml
File metadata and controls
86 lines (73 loc) · 2.76 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Lint & Validate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v14
with:
globs: "**/*.md !tests/**/*.md"
- name: Check spelling
uses: streetsidesoftware/cspell-action@v5
with:
files: "**/*.md !tests/**/*.md"
config: "./cspell.json"
- name: Check links
uses: lycheeverse/lychee-action@v1
with:
args: --verbose --no-progress --exclude-mail './**/*.md'
fail: true
- name: AISD forbidden words check
run: |
echo "Checking for forbidden words (should/might/could/typically/usually/often)..."
# Exclude README.md, CHANGELOG.md, AGENTS.md, and tests/ from this check
if find . -name "*.md" ! -path "./tests/*" ! -name "README.md" ! -name "CHANGELOG.md" ! -name "AGENTS.md" -exec grep -l -E "\b(should|might|could|typically|usually|often)\b" {} \; | grep -q .; then
echo "❌ Found forbidden words in the following files:"
find . -name "*.md" ! -path "./tests/*" ! -name "README.md" ! -name "CHANGELOG.md" ! -name "AGENTS.md" -exec grep -Hn -E "\b(should|might|could|typically|usually|often)\b" {} \;
echo ""
echo "Use MUST/REQUIRED/FORBIDDEN instead per AISD style guide."
exit 1
fi
echo "✅ No forbidden words found"
- name: AISD line count check
run: |
echo "Checking docs/ and spec/ files for line count (max 600)..."
failed=0
for file in docs/*.md docs/**/*.md spec/*.md; do
[ -f "$file" ] || continue
lines=$(wc -l < "$file")
if [ "$lines" -gt 600 ]; then
echo "❌ $file has $lines lines (max 600)"
failed=1
fi
done
if [ "$failed" -eq 1 ]; then
echo "Consider splitting large files."
exit 1
fi
echo "✅ All docs and spec files within line limit"
commitlint:
name: Commit Messages
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install commitlint
run: npm install -g @commitlint/cli @commitlint/config-conventional
- name: Validate PR commits
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose