-
Notifications
You must be signed in to change notification settings - Fork 3
185 lines (158 loc) · 4.34 KB
/
docs.yml
File metadata and controls
185 lines (158 loc) · 4.34 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Documentation
on:
push:
branches: [ main, dev/* ]
pull_request:
branches: [ main ]
jobs:
documentation:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: '25.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-docs-${{ hashFiles('**/Cargo.lock') }}
- name: Build documentation
run: |
cargo doc --workspace --all-features --no-deps
- name: Check for broken links in docs
run: |
cargo doc --workspace --all-features --no-deps 2>&1 | tee doc-output.txt
if grep -i "warning.*broken.*link\|error.*broken.*link" doc-output.txt; then
echo "Found broken links in documentation!"
exit 1
fi
- name: Deploy documentation (main branch only)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
destination_dir: docs
lint-markdown:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Lint markdown files
run: |
markdownlint README.md mqtt_grpc_duality/README.md docs/*.md || true
check-links:
name: Check Links
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install markdown-link-check
run: npm install -g markdown-link-check
- name: Check links in README
run: |
markdown-link-check README.md --config .github/markdown-link-check-config.json || true
- name: Check links in proxy README
run: |
markdown-link-check mqtt_grpc_duality/README.md --config .github/markdown-link-check-config.json || true
- name: Check links in docs
run: |
find docs -name "*.md" -exec markdown-link-check {} --config .github/markdown-link-check-config.json \; || true
spell-check:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install cspell
run: npm install -g cspell
- name: Create cspell config
run: |
cat > cspell.json << 'EOF'
{
"version": "0.2",
"language": "en",
"words": [
"flowsdk",
"mqtt",
"grpc",
"protobuf",
"tokio",
"serde",
"prost",
"tonic",
"dashmap",
"mqttv5",
"connack",
"puback",
"pubrel",
"pubcomp",
"suback",
"unsuback",
"qos",
"utf8",
"rustc",
"clippy",
"rustfmt",
"github",
"codecov",
"linux",
"macos",
"windows",
"aarch64",
"x86_64",
"dockerfile",
"cargo",
"toml",
"yaml",
"crates",
"serialization",
"deserialization",
"bidirectional",
"impl",
"async",
"await",
"struct",
"enum",
"Vec",
"HashMap",
"String"
],
"ignorePaths": [
"target/**",
"**/target/**",
".git/**",
"**/.git/**",
"fuzz/artifacts/**",
"fuzz/corpus/**"
]
}
EOF
- name: Run spell check
run: |
cspell "**/*.md" "**/*.rs" --config cspell.json || true