-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (99 loc) · 3.12 KB
/
Copy pathdocs.yml
File metadata and controls
107 lines (99 loc) · 3.12 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
name: docs
on:
pull_request:
paths:
- '**/*.md'
- '.markdownlint.json'
- '.github/workflows/docs.yml'
- 'tools/**'
- 'src/main/cpp/it/d4np/memorypool/version.hpp'
push:
branches: [master]
paths:
- '**/*.md'
- '.markdownlint.json'
- '.github/workflows/docs.yml'
- 'tools/**'
- 'src/main/cpp/it/d4np/memorypool/version.hpp'
permissions:
contents: read
pull-requests: read
jobs:
markdownlint:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DavidAnson/markdownlint-cli2-action@v23
with:
globs: |
**/*.md
!**/node_modules/**
linkcheck:
name: Check internal links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Lychee — offline (internal links only)
uses: lycheeverse/lychee-action@v2
with:
args: --offline --no-progress --include-fragments './**/*.md'
fail: true
adr-sanity:
name: ADR numbering & index sanity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Verify sequential numbering and index coverage
shell: bash
run: |
set -euo pipefail
shopt -s nullglob
adrs=(docs/adr/[0-9][0-9][0-9][0-9]-*.md)
if [[ ${#adrs[@]} -eq 0 ]]; then
echo "::warning::No ADRs found — skipping sanity check."
exit 0
fi
IFS=$'\n' adrs=($(sort <<<"${adrs[*]}")); unset IFS
# 1. Sequential numbering: 0001, 0002, ... with no gaps or duplicates.
expected=1
for adr in "${adrs[@]}"; do
num=$(basename "$adr" | cut -c1-4)
printf -v want "%04d" "$expected"
if [[ "$num" != "$want" ]]; then
echo "::error file=$adr::ADR numbering gap or duplicate — expected $want, found $num"
exit 1
fi
expected=$((expected + 1))
done
echo "ADR sequential numbering OK ($((expected - 1)) ADRs)."
# 2. Every ADR file must appear in the index README.
index="docs/adr/README.md"
if [[ ! -f "$index" ]]; then
echo "::error::Missing $index"
exit 1
fi
missing=0
for adr in "${adrs[@]}"; do
slug=$(basename "$adr" .md)
if ! grep -q -- "$slug" "$index"; then
echo "::error file=$adr::ADR '$slug' is not listed in $index"
missing=$((missing + 1))
fi
done
if [[ $missing -gt 0 ]]; then
exit 1
fi
echo "All ADRs are listed in $index."
consistency:
name: Project consistency lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# The i18n-freshness check compares each translation's recorded source
# commit against the source file's history, so it needs full history,
# not the default shallow clone.
fetch-depth: 0
- name: Run the consistency lint
run: python3 tools/consistency_lint.py