Validate Documentation #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Documentation | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Daily at 6am UTC | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| pip install requests>=2.32.0 | |
| pip install pytest pytest-cov pytest-asyncio pytest-mock pyyaml | |
| - name: Validate all paths reachable | |
| run: python scripts/lookup_paths.py --validate-all | |
| - name: Run validation tests | |
| run: | | |
| if [ -d "tests/validation" ] && [ "$(ls -A tests/validation)" ]; then | |
| pytest tests/validation/ -v --tb=short | |
| else | |
| echo "Validation tests not yet implemented" | |
| fi | |
| - name: Generate validation report | |
| run: | | |
| set -euo pipefail | |
| mkdir -p reports | |
| # Use UTC dates and safe filename format | |
| REPORT_DATE=$(date -u +'%Y-%m-%d') | |
| REPORT_FILE="reports/validation-$(date -u +'%Y%m%d').md" | |
| # Use printf for safer output generation | |
| { | |
| printf "# Validation Report - %s\n" "${REPORT_DATE}" | |
| printf "\n" | |
| printf "Validation completed at %s\n" "$(date -u)" | |
| } > "${REPORT_FILE}" | |
| - name: Upload report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validation-report | |
| path: reports/validation-*.md |