test: add comprehensive testing infrastructure
- 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
This commit is contained in:
parent
d6f3d67724
commit
12e31ede91
6 changed files with 163 additions and 0 deletions
51
.github/workflows/test.yml
vendored
Normal file
51
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
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/
|
||||
Loading…
Add table
Add a link
Reference in a new issue