Files
proffesor-for-testing__agen…/.github/workflows/verify-documentation.yml
Profa 34034062f9 ci: optimize workflows for ~70% cost reduction
## Deleted (redundant/obsolete)
- quality-gate.yml - duplicated optimized-ci functionality
- migration-validation.yml - test migration is complete

## Modified
- benchmark.yml: changed from push/PR to weekly + release-only
- learning-integration.yml: stricter path filters, reduced timeout 15→10min
- verify-documentation.yml: removed daily cron, PR-only now

## Remaining Workflows (6)
- optimized-ci.yml (primary CI)
- npm-publish.yml (release-only)
- mcp-tools-test.yml (path-filtered)
- benchmark.yml (weekly + release)
- learning-integration.yml (path-filtered)
- verify-documentation.yml (PR-only)

Expected savings: ~70% CI cost reduction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 11:54:39 +00:00

127 lines
4.2 KiB
YAML

name: Verify Documentation Accuracy
# Optimized: Removed daily cron to reduce CI costs
# Only runs on PRs to main and manual dispatch
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
verify-documentation:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Verify skill/agent counts
id: verify-counts
run: |
npm run verify:counts || echo "COUNTS_FAILED=true" >> $GITHUB_ENV
continue-on-error: true
- name: Verify agent skill references
id: verify-agent-skills
run: |
npm run verify:agent-skills || echo "AGENT_SKILLS_FAILED=true" >> $GITHUB_ENV
continue-on-error: true
- name: Verify feature claims
id: verify-features
run: |
npm run verify:features || echo "FEATURES_FAILED=true" >> $GITHUB_ENV
continue-on-error: true
- name: Upload verification reports
uses: actions/upload-artifact@v4
if: always()
with:
name: verification-reports
path: reports/verification-*.json
retention-days: 30
- name: Comment PR with results
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const reportsDir = 'reports';
let comment = '## 📊 Documentation Verification Report\n\n';
// Read latest reports
const files = fs.readdirSync(reportsDir)
.filter(f => f.startsWith('verification-') && f.endsWith('.json'))
.map(f => ({
name: f,
time: fs.statSync(path.join(reportsDir, f)).mtime.getTime()
}))
.sort((a, b) => b.time - a.time);
const countsFailed = process.env.COUNTS_FAILED === 'true';
const agentSkillsFailed = process.env.AGENT_SKILLS_FAILED === 'true';
const featuresFailed = process.env.FEATURES_FAILED === 'true';
comment += `### Status\n\n`;
comment += `- Counts Verification: ${countsFailed ? '❌ Failed' : '✅ Passed'}\n`;
comment += `- Agent Skills Verification: ${agentSkillsFailed ? '❌ Failed' : '✅ Passed'}\n`;
comment += `- Features Verification: ${featuresFailed ? '❌ Failed' : '✅ Passed'}\n\n`;
if (countsFailed || agentSkillsFailed || featuresFailed) {
comment += '### ⚠️ Action Required\n\n';
if (countsFailed) {
comment += '- Documentation counts do not match actual counts\n';
comment += '- Run `npm run update:counts` to fix\n';
}
if (agentSkillsFailed) {
comment += '- Some agent skill references are broken\n';
comment += '- Review broken references and fix agent markdown files\n';
}
if (featuresFailed) {
comment += '- Some feature claims cannot be verified\n';
comment += '- Review implementation or update documentation\n';
}
comment += '\n';
}
comment += '### 📄 Reports\n\n';
comment += 'Detailed reports are available as workflow artifacts.\n';
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment
});
- name: Fail if verification failed
if: |
env.COUNTS_FAILED == 'true' ||
env.AGENT_SKILLS_FAILED == 'true' ||
env.FEATURES_FAILED == 'true'
run: |
echo "::error::Documentation verification failed. Please review the reports."
exit 1