-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: check internal links in mdbook after build #3015
Conversation
43c774e
to
886ceef
Compare
I want to introduce another link checking job that works on the HTML output, so I am renaming our existing link check job to disambiguate it.
886ceef
to
e695fd2
Compare
@@ -92,7 +92,7 @@ jobs: | |||
# Check out `test-all.yaml` for more ideas on organizing these. | |||
if: always() | |||
needs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to include the new check-links-book
job under check-ok-to-merge.needs
... however I guess then we could no longer use on.pull_request.paths
in the new workflow file? And would probably have to do something like what's described in this blog post?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, unfortunately I'm not sure it's easy to do this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw what you did here — nice! I had seen this action before, but hadn't tried it out yet. Looks good; we could think about extending to more places if it turns out well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea!
- name: Build the mdbook | ||
run: mdbook build web/book/ | ||
|
||
- name: Check links |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One option would be to add this to the existing workflow, or to call the existing workflow as part of this. But no strong view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though possibly moving the job into build-web.yaml
would be a reasonable consolidation — it would run slightly too often, but not by much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning on linking relevant pages of the book from doc comments in prql_ast
in the future ... at which point I want to expand this CI job to check these links as well ... so I think it would be best to keep these separate since they have different path requirements and do largely different things.
4393db0
to
2331008
Compare
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: 0.8.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, prefix-key should be updated by the Cargo.toml.
prql/crates/prql_compiler/Cargo.toml
Lines 78 to 85 in 0224b6e
# Replace the cache key, since the caches seem to accumulate cruft over time; | |
# ref https://github.com/PRQL/prql/pull/2407 (and there's no GHA variable that | |
# contains the current version unfortunately). | |
[[package.metadata.release.pre-release-replacements]] | |
exactly = 1 | |
file = "../.github/workflows/build-web.yaml" | |
replace = 'prefix-key: {{version}}' | |
search = 'prefix-key: [\d.]+' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed that, thanks @eitsupi
We already run
markdown-link-check
in our CI, however by virtue of it running against.md
files it cannot detect links that are broken due to mdbook-specifics (such as forgetting to list the .md file in SUMMARY.md or the README.md bug). I already fixed 5 such broken links in #3017 and #2990 ... we should really detect these broken links in the CI.This PR therefore adds a new
link-check-book
job to our CI that builds the mdbook and then checks the generated HTML for broken links with the hyperlink link checker.