-
Notifications
You must be signed in to change notification settings - Fork 0
266 lines (239 loc) Β· 9.09 KB
/
cargo-doc.yml
File metadata and controls
266 lines (239 loc) Β· 9.09 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# Cargo Documentation Generation and Publishing
#
# Builds rustdoc for all workspace crates and publishes to GitHub Pages.
#
# - Generates docs with private items visible (for completeness)
# - Creates a root index page linking to all crates
# - Publishes to gh-pages branch automatically on push to master
name: Cargo Doc
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.85"
RUSTFLAGS: "--cap-lints warn"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build workspace documentation
run: |
# Build docs for all workspace crates with private items visible
cargo doc \
--workspace \
--all-features \
--no-deps \
--document-private-items
env:
RUSTFLAGS: "-D warnings"
- name: Add root index
run: |
cat > target/doc/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<title>MorpheusX API Documentation</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
margin: 0;
padding: 2rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
h1 {
margin-top: 0;
color: #333;
border-bottom: 3px solid #667eea;
padding-bottom: 0.5rem;
}
.intro {
color: #666;
line-height: 1.6;
font-size: 1.1rem;
}
.crate-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin-top: 2rem;
}
.crate-card {
border: 1px solid #ddd;
border-radius: 6px;
padding: 1.5rem;
transition: all 0.3s ease;
}
.crate-card:hover {
border-color: #667eea;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
transform: translateY(-2px);
}
.crate-card h3 {
margin: 0 0 0.5rem 0;
color: #333;
}
.crate-card a {
color: #667eea;
text-decoration: none;
font-weight: 600;
}
.crate-card a:hover {
text-decoration: underline;
}
.crate-desc {
color: #666;
font-size: 0.95rem;
margin: 0.5rem 0;
}
.crate-status {
display: inline-block;
font-size: 0.8rem;
padding: 0.2rem 0.6rem;
border-radius: 3px;
margin-top: 0.5rem;
background: #f0f0f0;
color: #666;
}
.crate-status.stable {
background: #d4edda;
color: #155724;
}
.crate-status.experimental {
background: #fff3cd;
color: #856404;
}
footer {
margin-top: 2rem;
padding-top: 1rem;
border-top: 1px solid #ddd;
text-align: center;
color: #999;
font-size: 0.9rem;
}
</style>
</head>
<body>
<div class="container">
<h1>π§ MorpheusX API Documentation</h1>
<div class="intro">
<p>
MorpheusX is a UEFI/bare-metal bootloader and exokernel with self-persisting runtime capabilities.
This documentation covers all crates in the MorpheusX workspace.
</p>
<p>
<strong>Key Features:</strong> Post-EBS networking, ISO9660 support, FAT32 filesystem,
UEFI compatibility, and self-updating capabilities.
</p>
</div>
<h2>Workspace Crates</h2>
<div class="crate-grid">
<div class="crate-card">
<h3>π¦ morpheus-bootloader</h3>
<p class="crate-desc">UEFI bootloader and core kernel entry point</p>
<a href="morpheus_bootloader/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
<div class="crate-card">
<h3>π morpheus-core</h3>
<p class="crate-desc">Core types, ISO handling, and filesystem abstractions</p>
<a href="morpheus_core/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
<div class="crate-card">
<h3>π morpheus-network</h3>
<p class="crate-desc">Post-EBS network stack with VirtIO drivers and smoltcp integration</p>
<a href="morpheus_network/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
<div class="crate-card">
<h3>πΎ morpheus-persistent</h3>
<p class="crate-desc">Self-persistence layer for runtime survival across boots</p>
<a href="morpheus_persistent/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
<div class="crate-card">
<h3>π morpheus-updater</h3>
<p class="crate-desc">In-place update mechanism for bootloader persistence</p>
<a href="morpheus_updater/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
<div class="crate-card">
<h3>π iso9660-rs</h3>
<p class="crate-desc">ISO 9660 filesystem parser and writer</p>
<a href="iso9660_rs/index.html">View Docs β</a>
<span class="crate-status stable">Stable</span>
</div>
</div>
<h2>Documentation Guidelines</h2>
<ul style="color: #666; line-height: 1.8;">
<li><strong>Module-level docs:</strong> Each module explains its purpose and usage patterns</li>
<li><strong>Private items:</strong> Included in docs for implementation reference</li>
<li><strong>Examples:</strong> See individual crate docs for code examples</li>
<li><strong>SAFETY comments:</strong> Unsafe code is extensively documented</li>
</ul>
<h2>Getting Started</h2>
<p style="color: #666;">
Start with <a href="morpheus_bootloader/index.html" style="color: #667eea; font-weight: 600;">morpheus-bootloader</a>
for the main entry point, then explore individual crates for specific functionality.
</p>
<footer>
<p>Generated on {{ date }} β’ <a href="https://github.com/PopRdi/morpheusx" style="color: #667eea;">View on GitHub</a></p>
</footer>
</div>
</body>
</html>
EOF
- name: Setup Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
retention-days: 1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4