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

Adding GitHub action for link check of user guide #1441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/htmltest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# .github/workflows/htmltest.yml
# Run htmltest link checker on generated HTML output from user guide

name: Link check with htmltest

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
htmltest:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
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: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.16.0'
cache: 'npm'
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: '**/package-lock.json'

# - run: npm --prefix=userguide --include=dev ci
- run: npm install postcss postcss-cli autoprefixer
- run: hugo --source userguide --destination $GITHUB_WORKSPACE/userguide/public --themesDir ../../ --theme docsy

- name: Test HTML
# https://github.com/wjdp/htmltest-action/
continue-on-error: false # <- Set to true if run shouldn't fail with broken links
uses: wjdp/htmltest-action@master
with:
# For consistency, use the same config file as for local builds
config: userguide/.htmltest.yml
path: userguide/public

- name: Archive htmltest results
uses: actions/upload-artifact@v3
with:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7 # default is 90 days
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
package-lock.json

# Hugo
.hugo_build.lock
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = "userguide/public"
command = "npm run docs-install && npm run build:preview"

[build.environment]
GO_VERSION = "1.19.5"
GO_VERSION = "1.20.5"
HUGO_THEME = "repo"

[context.production]
Expand Down