Skip to content

Commit 1eac616

Browse files
authored
DOCS-3812: Add htmlcheck to TS docs (#516)
1 parent d2f08cd commit 1eac616

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

.github/workflows/linkcheck.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# .github/workflows/run-htmltest.yml
2+
# (c) 2021 Robb Romans
3+
#
4+
# Run htmltest link checker on generated HTML output in dist/
5+
# https://github.com/wjdp/htmltest
6+
#
7+
name: run-htmltest-external
8+
on:
9+
schedule:
10+
# 10am UTC on Mondays
11+
- cron: "0 10 * * 1"
12+
jobs:
13+
htmltest:
14+
if: github.repository_owner == 'viamrobotics'
15+
runs-on: ubuntu-latest
16+
container:
17+
image: ghcr.io/viamrobotics/canon:amd64
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v4
21+
22+
- name: Build + Pack
23+
run: |
24+
sudo chown -R testbot .
25+
sudo -u testbot bash -lc 'make build pack'
26+
27+
- name: Test HTML
28+
# https://github.com/wjdp/htmltest-action/
29+
# Don't fail the build on broken links
30+
continue-on-error: false
31+
uses: wjdp/htmltest-action@master
32+
with:
33+
config: .htmltest.yml
34+
- name: Archive htmltest results
35+
uses: actions/upload-artifact@v4
36+
# Note: Set ACTIONS_RUNTIME_TOKEN env variable to test with nektos/act
37+
with:
38+
name: htmltest-report
39+
path: tmp/.htmltest/htmltest.log
40+
retention-days: 7 # Default is 90 days
41+
- name: Login to Jira
42+
if: failure()
43+
uses: atlassian/gajira-login@v3
44+
env:
45+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
46+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
47+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
48+
- name: Create Jira ticket
49+
if: failure()
50+
id: create
51+
uses: atlassian/gajira-create@v3
52+
env:
53+
GITHUB_RUN_ID: ${{ github.run_id }}
54+
with:
55+
project: DOCS
56+
issuetype: Bug
57+
summary: Broken link detected in TS docs
58+
description: "For more info see https://github.com/viamrobotics/viam-typsescript-sdk/actions/runs/${{ env.GITHUB_RUN_ID }}."
59+
- name: Log created Jira issue
60+
if: failure()
61+
run: echo "Issue ${{ steps.create.outputs.issue }} was created"

.htmltest.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
DirectoryPath: "docs/dist"
2+
EnforceHTTPS: true
3+
IgnoreEmptyHref: true
4+
IgnoreInternalEmptyHash: true
5+
IgnoreDirectoryMissingTrailingSlash: false
6+
IgnoreURLs:
7+
- "app.viam.com"
8+
- "http://joda-time.sourceforge.net"
9+
IgnoreDirs:
10+
- "lib"
11+
CacheExpires: "6h"
12+
# IgnoreDirs: - if we need to ever ignore files
13+
CheckInternal: false
14+
CheckDoctype: false
15+
CheckScripts: false
16+
FileExtension: ".html"

0 commit comments

Comments
 (0)