Skip to content

Commit

Permalink
DOCS-1484: Run htmltest on external links weekly (#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Mar 13, 2024
1 parent 945a163 commit fde93f4
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/failed-action-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Failed htmltest
assignees: npentrel
labels: bug
---

See [the action log](https://github.com/{{ env.GITHUB_ACTION_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}) for more details.
46 changes: 46 additions & 0 deletions .github/workflows/run-htmltest-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/run-htmltest.yml
# (c) 2021 Robb Romans
#
# Run htmltest link checker on generated HTML output in dist/
# https://github.com/wjdp/htmltest
#
name: run-htmltest
concurrency:
group: pullrequest-untrusted-htmltest-${{ github.event.number }}
cancel-in-progress: true
on: pull_request
jobs:
htmltest:
runs-on: ubuntu-large
container:
image: ghcr.io/viamrobotics/canon:amd64
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true

- name: Build
run: make build-dist

- name: Test HTML for local pages
# https://github.com/wjdp/htmltest-action/
# Don't fail the build on broken links
continue-on-error: false
uses: wjdp/htmltest-action@master
with:
# For consistency, use the same config file as for local builds
config: .htmltest-local.yml
- name: Archive htmltest results
uses: actions/upload-artifact@v3
# Note: Set ACTIONS_RUNTIME_TOKEN env variable to test with nektos/act
with:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7 # Default is 90 days
17 changes: 12 additions & 5 deletions .github/workflows/run-htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# Run htmltest link checker on generated HTML output in dist/
# https://github.com/wjdp/htmltest
#
name: run-htmltest
concurrency:
group: pullrequest-untrusted-htmltest-${{ github.event.number }}
cancel-in-progress: true
on: pull_request
name: run-htmltest-external
on:
schedule:
# 10am UTC on weekdays
- cron: '0 10 * * 1,2,3,4,5'
jobs:
htmltest:
runs-on: ubuntu-large
Expand Down Expand Up @@ -44,3 +44,10 @@ jobs:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7 # Default is 90 days
- name: Create issue about failure
if: failure()
uses: JasonEtco/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/failed-action-issue-template.md
37 changes: 37 additions & 0 deletions .htmltest-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
DirectoryPath: "dist"
EnforceHTTPS: true
IgnoreEmptyHref: true
IgnoreInternalEmptyHash: true
IgnoreDirectoryMissingTrailingSlash: false
IgnoreURLs:
- "example.com"
- "^/misc/js/script.js$"
- "linkedin.com"
- "app.viam.com"
- "beaglebone.local"
- "instagram.com"
- "twitter.com"
- "github.com/viamrobotics/docs"
- "openai.com"
- "espressif.com"
- "pinout.xyz"
- "play.google.com"
- "scuttlerobot.org"
- "numato.com"
- "nvidia.com"
- "slamtec.com"
- "universal-robots.com"
- "digikey.com"
- "ufactory.cc"
- "medium.com"
- "radxa.com"
- "electronics-tutorials.ws"
- "marketplace.visualstudio.com"
- "chrome.google.com"
- "raspberrypi.com"
- "grabcad.com"
IgnoreDirs:
- "lib"
CacheExpires: "6h"
# IgnoreDirs: - if we need to ever ignore files
IgnoreExternalBrokenLinks: true

0 comments on commit fde93f4

Please sign in to comment.