- Add npm test scripts for build, markdown, HTML, and link validation - Install markdownlint-cli for content quality checks - Install html-validate for HTML5 conformity validation - Add htmltest (via devbox) for internal/external link checking - Configure test rules in .htmltest.yml, .htmlvalidate.json, .markdownlint.json - Add GitHub Actions workflow for automated CI testing - Add TESTING.md documentation for test usage
51 lines
984 B
YAML
51 lines
984 B
YAML
name: Hugo Site Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v3
|
|
with:
|
|
hugo-version: 'latest'
|
|
extended: true
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm ci
|
|
go install github.com/wjdp/htmltest@latest
|
|
|
|
- name: Run tests
|
|
run: |
|
|
npm run test:build
|
|
npm run test:markdown
|
|
npm run test:html
|
|
|
|
- name: Run link checker
|
|
run: htmltest
|
|
continue-on-error: true
|
|
|
|
- name: Upload htmltest results
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: htmltest-report
|
|
path: tmp/.htmltest/
|