-
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (80 loc) · 2.59 KB
/
docs-ci.yml
File metadata and controls
94 lines (80 loc) · 2.59 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
name: Documentation CI
on:
push:
branches: [ main ]
paths:
- 'docs/**'
- '*.md'
- '.github/workflows/docs-ci.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- '*.md'
- '.github/workflows/docs-ci.yml'
jobs:
markdown-lint:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Lint markdown files
uses: DavidAnson/markdownlint-cli2-action@v11
with:
globs: |
**/*.md
!node_modules
!.git
check-links:
name: Check Markdown Links
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check links in markdown files
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
config-file: '.github/markdown-link-check-config.json'
check-modified-files-only: 'no'
validate-structure:
name: Validate Documentation Structure
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check required documentation files
run: |
# Check root documentation
test -f README.md || exit 1
test -f CONTRIBUTING.md || exit 1
test -f CODE_OF_CONDUCT.md || exit 1
test -f SECURITY.md || exit 1
test -f CHANGELOG.md || exit 1
test -f LICENSE || exit 1
# Check documentation structure
test -d docs/getting-started || exit 1
test -d docs/api || exit 1
# Check critical guides exist
test -f docs/getting-started/choosing-platform.md || exit 1
test -f docs/getting-started/arduino-quickstart.md || exit 1
test -f docs/getting-started/raspberry-pi-quickstart.md || exit 1
test -f docs/api/osc-protocol.md || exit 1
echo "All required documentation files present"
- name: Check for broken internal links
run: |
# Simple check for broken relative links
for file in $(find . -name "*.md"); do
echo "Checking $file"
grep -o '\[.*\](.*\.md)' "$file" | while read link; do
path=$(echo "$link" | sed 's/.*](\(.*\))/\1/')
dir=$(dirname "$file")
if [ ! -f "$dir/$path" ]; then
echo "Broken link in $file: $path"
exit 1
fi
done
done
echo "Internal links check complete"