hydroflow icon indicating copy to clipboard operation
hydroflow copied to clipboard

ci: check README links against local website build in CI

Open Copilot opened this issue 2 months ago • 2 comments

README links to hydro.run were not validated in CI, and when validated externally, checked against the live site instead of the PR's changes. This prevented catching broken links when the README and website changed together in the same PR.

Changes

  • scripts/check_readme_links.sh: Extracts hydro.run URLs from README and validates each against the local docs/build output

    • Maps URLs to filesystem paths: https://hydro.run/docs/hydro/docs/build/docs/hydro/index.html
    • Handles static files (PDFs), pages with/without trailing slashes
    • Exits non-zero if any link is broken
  • .github/workflows/build-website.yml: Added link validation step after website build

$ bash scripts/check_readme_links.sh
Checking README links against local website build...

✓ https://hydro.run
✓ https://hydro.run/docs/hydro/
✗ https://hydro.run/docs/missing-page
  Expected file: docs/build/docs/missing-page/index.html

Checked 3 links
ERROR: 1 link(s) failed validation

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • rustwasm.github.io
    • Triggering command: curl REDACTED -sSf (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Test README for broken links in CI job for website</issue_title> <issue_description>We should check the links against the build of the website from the CI job, instead of https://hydro.run, since we might change the website and the README in the same PR. Can probably extract the README links for hydro.run, extract the path from the URL, and check that it exists in the local website build.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes hydro-project/hydro#2237

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Oct 31 '25 19:10 Copilot

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: de00279
Status: ✅  Deploy successful!
Preview URL: https://a527ba51.hydroflow.pages.dev
Branch Preview URL: https://copilot-test-readme-links-ci.hydroflow.pages.dev

View logs

Actually I guess we need to test against the local website build

MingweiSamuel avatar Oct 31 '25 22:10 MingweiSamuel