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: add link-checker #986

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ jobs:
env:
JEKYLL_ENV: production

- name: Check validity of links
uses: lycheeverse/lychee-action@v1
with:
# Reasons for exclude
# - https://root.cern/[0-9]+: Breaks checking local builds due to links in the metadata
# - https://root.cern/(?!(files|download|doc)): Checking links to the deployed website breaks appearing in the metadata of newly added webpages. Exceptions are links to files, download and doc, which are not part of the Jekyll setup.
# - rootbnch-grafana-test.cern.ch: Breaks due to SSO
# - lcgapp-services.cern.ch: Breaks due to SSO
# - indico.desy.de: Returns frequently error code 403
# - https://www.sciencedirect.com: frequent 403 errors
# - nbviewer: When notebook generation fails, nbviewer returns 404 errors, and errors might even be cached in CDNs for a while
# - lcginfo.cern.ch: does not support HTTPS, see https://sft.its.cern.ch/jira/browse/SPI-1672
# - http://simul.iro.umontreal.ca/testu01/tu01.html does not support HTTPS
# Reasons for --exclude-path
# - Broken links in historic ROOT v5 release notes
#
# add `--include-fragments` once released!
args: --base build/ --no-progress --exclude-mail --exclude-path './build/${PR_NUMBER}/install/all_releases/' --exclude https://rootbnch-grafana-test.cern.ch --exclude https://lcgapp-services.cern.ch/root-jenkins --exclude https://indico.desy.de --exclude https://nbviewer.jupyter.org --exclude https://www.sciencedirect.com --exclude https://github.com/root-project/web/tree/ --exclude https://twitter.com/ROOT_Project ${{ github.event_name == 'pull_request' && '--remap "https://root.cern/${PR_NUMBER} file://" ' || ''}} 'build/**/*.html'
# Fail action on broken links
fail: true

- name: Only allow links to root.cern, never root.cern.ch
run: |
grep -n -R 'root\.cern\.ch' build || exit 0 # grep returns non-zero if no match is found
Expand Down
Loading