96 lines
2.7 KiB
YAML
Executable File
96 lines
2.7 KiB
YAML
Executable File
# .gitea/workflows/docs.yml
|
|
# Documentation quality checks and preview artefacts
|
|
|
|
name: Docs CI
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'docs/**'
|
|
- 'scripts/render_docs.py'
|
|
- '.gitea/workflows/docs.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'docs/**'
|
|
- 'scripts/render_docs.py'
|
|
- '.gitea/workflows/docs.yml'
|
|
workflow_dispatch: {}
|
|
|
|
env:
|
|
NODE_VERSION: '20'
|
|
PYTHON_VERSION: '3.11'
|
|
|
|
jobs:
|
|
lint-and-preview:
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
DOCS_OUTPUT_DIR: ${{ github.workspace }}/artifacts/docs-preview
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Install documentation toolchain
|
|
run: |
|
|
npm install --no-save markdown-link-check remark-cli remark-preset-lint-recommended ajv ajv-cli ajv-formats
|
|
|
|
- name: Setup .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10.0.100-rc.2.25502.107'
|
|
|
|
- name: Link check
|
|
run: |
|
|
find docs -name '*.md' -print0 | \
|
|
xargs -0 -n1 -I{} npx markdown-link-check --quiet '{}'
|
|
|
|
- name: Remark lint
|
|
run: |
|
|
npx remark docs -qf
|
|
|
|
- name: Validate event schemas
|
|
run: |
|
|
set -euo pipefail
|
|
for schema in docs/events/*.json; do
|
|
npx ajv compile -c ajv-formats -s "$schema"
|
|
done
|
|
for sample in docs/events/samples/*.json; do
|
|
schema_name=$(basename "$sample" .sample.json)
|
|
schema_path="docs/events/${schema_name}.json"
|
|
if [ ! -f "$schema_path" ]; then
|
|
echo "Missing schema for sample ${sample}" >&2
|
|
exit 1
|
|
fi
|
|
npx ajv validate -c ajv-formats -s "$schema_path" -d "$sample"
|
|
done
|
|
|
|
- name: Run Notify schema validation tests
|
|
run: |
|
|
dotnet test src/StellaOps.Notify.Models.Tests/StellaOps.Notify.Models.Tests.csproj --configuration Release --nologo
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Install documentation dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install markdown pygments
|
|
|
|
- name: Render documentation preview bundle
|
|
run: |
|
|
python scripts/render_docs.py --source docs --output "$DOCS_OUTPUT_DIR" --clean
|
|
|
|
- name: Upload documentation preview
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: feedser-docs-preview
|
|
path: ${{ env.DOCS_OUTPUT_DIR }}
|
|
retention-days: 7
|