-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (123 loc) · 4.78 KB
/
qa.yml
File metadata and controls
134 lines (123 loc) · 4.78 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
name: QA
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# ── 0. Build freshness ──────────────────────────────────────────────────────
build-fresh:
name: Build freshness check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install -r requirements.txt
- name: Check generated files match templates
run: python3 build.py --check
# ── 1. Typos ────────────────────────────────────────────────────────────────
typos:
name: Typo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1
# ── 2. German spelling ─────────────────────────────────────────────────────
cspell-de:
name: German pages spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Spell-check German pages
run: |
npx --yes \
-p cspell \
-p @cspell/dict-de-de \
-p @cspell/dict-de-at \
cspell lint --config cspell.de.json
# ── 3. English spelling ────────────────────────────────────────────────────
cspell-en:
name: English pages spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Spell-check English pages
run: |
npx --yes \
-p cspell \
cspell lint --config cspell.en.json
# ── 4. HTML validity ────────────────────────────────────────────────────────
html:
name: HTML validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install -g html-validate
- name: Validate HTML
run: |
html-validate \
index.html \
kern/ \
technology/ \
references/ \
company/ \
includes/nav.html \
includes/footer.html
# ── 5. Meta descriptions ────────────────────────────────────────────────────
meta:
name: Meta descriptions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Every KERN page must have a meta description
run: |
missing=0
while IFS= read -r file; do
if ! grep -qi '<meta name="description"' "$file"; then
echo "::error file=$file::Missing meta description"
missing=$((missing + 1))
fi
done < <(find index.html kern/ technology/ references/ \
company/about-us.html company/career.html \
company/get-in-touch.html company/media.html company/news.html \
-name "*.html" 2>/dev/null)
if [ "$missing" -gt 0 ]; then
echo "::error::$missing page(s) missing <meta name=\"description\">"
exit 1
fi
echo "All pages have meta descriptions ✓"
# ── 6. Image size budget ────────────────────────────────────────────────────
images:
name: Image size budget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Warn on images > 500 KB
run: |
limit=$((500 * 1024))
oversized=0
while IFS= read -r img; do
size=$(stat -c%s "$img")
if [ "$size" -gt "$limit" ]; then
kb=$((size / 1024))
echo "::warning file=$img::${kb} KB — consider compressing (budget: 500 KB)"
oversized=$((oversized + 1))
fi
done < <(find images/ -type f \( \
-iname "*.jpg" -o -iname "*.jpeg" \
-o -iname "*.png" -o -iname "*.gif" \
-o -iname "*.webp" \))
if [ "$oversized" -gt 0 ]; then
echo "$oversized image(s) over budget — see warnings above"
else
echo "All images within 500 KB budget ✓"
fi