Skip to content

Commit

Permalink
add check step to doc generation
Browse files Browse the repository at this point in the history
this should help catch errors that `cargo doc` doesn't catch. --quiet was also removed from cargo doc args
  • Loading branch information
Univa committed Dec 19, 2023
1 parent 033c8fe commit 4d5e989
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build output
dist/
temp/
# generated types
.astro/

Expand Down
35 changes: 34 additions & 1 deletion docs/scripts/gen_api_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,40 @@ function main() {
for (const target of manifest.package.metadata.rumcake_docs.flavours) {
const output_dir = path.join(".", "temp", target.feature);

console.log(`Checking rumcake for ${target.feature}.`);

const rustcheck = process.spawnSync(
"cargo",
[
"check",
"--release",
`--features=${
target.feature
},${manifest.package.metadata.rumcake_docs.features.join(
",",
)},${target.extra_features.join(",")}`,
"--target",
target.triple, // build target triple
"--target-dir",
output_dir.toString(),
"--manifest-path",
path.join("..", "rumcake", "Cargo.toml").toString(),
],
{
stdio: "inherit",
},
);

if (rustcheck.status) {
error = true;
console.error(`Check failed for ${target.feature}.`);
continue;
}

console.log(`rumcake for ${target.feature} has been checked successfully.`);

console.log(`Building ${target.feature} API docs.`);

const rustdoc = process.spawnSync(
"cargo",
[
Expand All @@ -117,7 +151,6 @@ function main() {
output_dir.toString(),
"--manifest-path",
path.join("..", "rumcake", "Cargo.toml").toString(),
"--quiet",
],
{
stdio: "inherit",
Expand Down

0 comments on commit 4d5e989

Please sign in to comment.