Skip to content
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(link-checker): use lychee instead of MLC #34

Merged
merged 3 commits into from
Jul 2, 2024
Merged

Conversation

Br1ght0ne
Copy link
Contributor

This PR changes mdbook-docs.yml workflow to use https://github.com/lycheeverse/lychee ("Fast, async, stream-based link checker written in Rust") via https://github.com/lycheeverse/lychee-action instead of MLC (markdown-link-check).

The lychee config file (lychee.toml) closely mirrors the settings from existing mlc.mdbook.json, and thus should work with any and all Markdown files. I opted to leave mlc.next.json as-is for now, because it uses extra configuration.

Reasoning for the change:

  • main reason - markdown-link-check operates on individual files (e.g., find . -name *md -exec markdown-link-check {};). This means that the errors are reported in the middle of the job output, which is quite long. Thus, it is difficult to find the actual error message. lychee uses globs like **/*.md natively (handled by lychee-action under the hood), meaning that there's a single report for all links in the repo's Markdown, with errors clearly visible. It looks like this by default (1 link failing on purpose):
  179/179 ━━━━━━━━━━━━━━━━━━━━ Finished extracting links                                                                                                                                                                                             Issues found in 1 input. Find details below.

[docs/src/connecting/external-node.md]:
✗ [403] https://faucet-beta-5.fuel.network/ | Failed: Network error: Forbidden

🔍 179 Total (in 1s) ✅ 177 OK 🚫 1 Error 💤 1 Excluded
  • lychee can use GHA cache to avoid checking the same links on repeated CI runs - this is configured in this PR
  • it's much faster than MLC, written in Rust and well-maintained (+ for security)

@Br1ght0ne Br1ght0ne added the enhancement New feature or request label Jun 8, 2024
@Br1ght0ne Br1ght0ne self-assigned this Jun 8, 2024
docs-hub/lychee.toml Outdated Show resolved Hide resolved
@Br1ght0ne Br1ght0ne requested a review from hal3e June 10, 2024 16:06
@Br1ght0ne Br1ght0ne requested a review from a team June 10, 2024 20:16
@Br1ght0ne Br1ght0ne merged commit 3b40a26 into master Jul 2, 2024
4 checks passed
@Br1ght0ne Br1ght0ne deleted the lychee-link-checker branch July 2, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants