Skip to content

Commit

Permalink
Fail when mdbook build has errors (#2780)
Browse files Browse the repository at this point in the history
<!-- Reference any GitHub issues resolved by this PR -->

Closes #2756

## Introduced changes

<!-- A brief description of the changes -->

Add a script which exits with code 1 in case when there are errors when
running `mdbook build`. This should be ofc done on mdbook's project
side, however it hasn't been addressed yet
(rust-lang/mdBook#2277).

Example run with broken docs url:

https://github.com/foundry-rs/starknet-foundry/actions/runs/12329947653/job/34414855443

## Checklist

<!-- Make sure all of these are complete -->

- [x] Linked relevant issue
- [x] Updated relevant documentation
- [x] Added relevant tests
- [x] Performed self-review of the code
- [x] Added changes to `CHANGELOG.md`
  • Loading branch information
franciszekjob authored Dec 17, 2024
1 parent 089de2c commit 62bc066
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ jobs:
run: |
cargo install mdbook-linkcheck
- name: Build with mdBook
run: mdbook build
working-directory: ./docs
run: |
# TODO(#2781): Use `mdbook build`
./scripts/build_docs.sh
- name: Install Forge
run: |
cargo install --path crates/forge --locked
Expand Down
13 changes: 13 additions & 0 deletions scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# TODO(#2781)

pushd docs

OUTPUT=$(mdbook build 2>&1)

echo "$OUTPUT"

if echo "$OUTPUT" | grep -q "\[ERROR\]"; then
exit 1
fi

0 comments on commit 62bc066

Please sign in to comment.