comprehensive-rust icon indicating copy to clipboard operation
comprehensive-rust copied to clipboard

Check for broken links in CI

Open mgeisler opened this issue 2 years ago • 2 comments

After #571 and #917 (thanks @eepeep and @djmitche!), it's becoming clear to me that we should check for broken links in our CI pipeline. The check should catch both 404 Not Found, but also know how to detect broken #fragments since those were the ones that became outdated in the past.

Since links can come and go at any moment, this test will not be super reliable — we might therefore want to only run it when something is merged into main. If it fails, people like me who are subscribed to the repository will get a mail and that should be enough for us to react.

mgeisler avatar Jul 12 '23 09:07 mgeisler

We should take a look at https://github.com/lycheeverse/lychee for this. It looks like it will do everything we need (and more!). In particular, I love that it has a --cache option: we should be able to cache the checks in a GitHub action for 5 or 10 days or so to not spend time checking the same links again and again.

mgeisler avatar Oct 25 '23 20:10 mgeisler

I don't know about lychee, but I've previously used mdbook-linkcheck like this:

https://github.com/google/rust-design-faq/blob/main/book.toml#L21 https://github.com/google/rust-design-faq/blob/main/.github/workflows/main.yml#L23

adetaylor avatar Nov 28 '23 20:11 adetaylor