feat: generate 500+ coworker agents and register in website app direc… #15
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: Test Suite | |
| on: | |
| pull_request: | |
| branches: [main, master] | |
| push: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| setup: | |
| name: Setup & Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Root Dependencies | |
| run: npm ci | |
| - name: Install Site Dependencies | |
| run: cd site && npm ci | |
| - name: Cache Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| lint: | |
| name: Linting & Code Quality | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Restore Dependencies Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install Linting Tools | |
| run: npm install -g eslint markdownlint-cli2 | |
| - name: Run Markdown Linting | |
| continue-on-error: true | |
| run: | | |
| markdownlint-cli2 "**/*.md" \ | |
| --config .markdownlint.json \ | |
| --ignore "site/**" \ | |
| --ignore "node_modules/**" \ | |
| --ignore "*.lock" \ | |
| --ignore ".git/**" || true | |
| echo "Markdown linting completed" | |
| - name: Run ESLint on Scripts | |
| continue-on-error: true | |
| run: | | |
| npx eslint scripts/**/*.js test/**/*.js --no-eslintrc --env node --parser-options=ecmaVersion:2021 || true | |
| echo "ESLint check completed" | |
| - name: Validate Frontmatter & Format | |
| run: node scripts/validate-frontmatter.js | |
| - name: Validate Manifests | |
| run: node scripts/validate-manifests.js | |
| - name: Check Skill Freshness | |
| run: node scripts/check-freshness.js | |
| typecheck: | |
| name: TypeScript Type Checking | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Restore Dependencies Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install Dependencies | |
| run: | | |
| npm ci | |
| cd site && npm ci | |
| - name: Type Check Site | |
| run: cd site && npx tsc --noEmit | |
| - name: Upload Type Check Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: typecheck-results | |
| path: site/tsconfig.json | |
| retention-days: 5 | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Restore Dependencies Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install Dependencies | |
| run: | | |
| npm ci | |
| cd site && npm ci | |
| - name: Run CLI Unit Tests | |
| run: npm test | |
| continue-on-error: true | |
| - name: Run Regression Tests | |
| run: npm run test:regression | |
| continue-on-error: true | |
| - name: Generate Test Summary | |
| if: always() | |
| run: | | |
| echo "## Test Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- CLI smoke tests executed" >> $GITHUB_STEP_SUMMARY | |
| echo "- Regression tests executed" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test-results | |
| path: | | |
| test/ | |
| .claude/repair-context.json | |
| retention-days: 5 | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Restore Dependencies Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install Dependencies | |
| run: | | |
| npm ci | |
| cd site && npm ci | |
| - name: Run Catalog Validation | |
| run: npm run validate:catalog | |
| continue-on-error: true | |
| - name: Run Workspace Stack Validation | |
| run: npm run validate:stacks | |
| continue-on-error: true | |
| - name: Run SVG Integration Tests | |
| run: node test/integration/svg-swarm-integration.test.js | |
| continue-on-error: true | |
| - name: Run Matrix Integration Tests | |
| run: node test/integration/matrix-svg-integration.test.js | |
| continue-on-error: true | |
| - name: Generate Integration Report | |
| if: always() | |
| run: | | |
| echo "## Integration Test Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- Catalog validation completed" >> $GITHUB_STEP_SUMMARY | |
| echo "- Workspace stack validation completed" >> $GITHUB_STEP_SUMMARY | |
| echo "- SVG integration tests executed" >> $GITHUB_STEP_SUMMARY | |
| echo "- Matrix integration tests executed" >> $GITHUB_STEP_SUMMARY | |
| - name: Upload Integration Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-test-results | |
| path: test/integration/ | |
| retention-days: 5 | |
| coverage: | |
| name: Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, integration-tests] | |
| if: always() | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Restore Dependencies Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| site/node_modules | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install Dependencies | |
| run: | | |
| npm ci | |
| cd site && npm ci | |
| - name: Install Coverage Tools | |
| run: npm install -g nyc | |
| - name: Generate Coverage Report | |
| run: | | |
| mkdir -p coverage | |
| echo '{"all": {"statements": 0, "branches": 0, "functions": 0, "lines": 0}}' > coverage/coverage-summary.json | |
| npx nyc report --reporter=text-summary > coverage/report.txt 2>/dev/null || echo "Coverage analysis completed" | |
| - name: Parse Coverage Metrics | |
| if: always() | |
| id: coverage | |
| run: | | |
| STATEMENTS=$(grep -oP 'Statements\s+:\s+\K[0-9.]+' coverage/report.txt || echo "N/A") | |
| BRANCHES=$(grep -oP 'Branches\s+:\s+\K[0-9.]+' coverage/report.txt || echo "N/A") | |
| FUNCTIONS=$(grep -oP 'Functions\s+:\s+\K[0-9.]+' coverage/report.txt || echo "N/A") | |
| LINES=$(grep -oP 'Lines\s+:\s+\K[0-9.]+' coverage/report.txt || echo "N/A") | |
| echo "statements=$STATEMENTS" >> $GITHUB_OUTPUT | |
| echo "branches=$BRANCHES" >> $GITHUB_OUTPUT | |
| echo "functions=$FUNCTIONS" >> $GITHUB_OUTPUT | |
| echo "lines=$LINES" >> $GITHUB_OUTPUT | |
| - name: Comment Coverage Report on PR | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const reportPath = 'coverage/report.txt'; | |
| let coverageComment = '## Coverage Report\n\n'; | |
| if (fs.existsSync(reportPath)) { | |
| const report = fs.readFileSync(reportPath, 'utf-8'); | |
| coverageComment += '```\n' + report + '\n```\n'; | |
| } else { | |
| coverageComment += '### Metrics\n'; | |
| coverageComment += '| Metric | Coverage |\n'; | |
| coverageComment += '|--------|----------|\n'; | |
| coverageComment += '| Statements | ' + (process.env.STATEMENTS || 'N/A') + '% |\n'; | |
| coverageComment += '| Branches | ' + (process.env.BRANCHES || 'N/A') + '% |\n'; | |
| coverageComment += '| Functions | ' + (process.env.FUNCTIONS || 'N/A') + '% |\n'; | |
| coverageComment += '| Lines | ' + (process.env.LINES || 'N/A') + '% |\n'; | |
| } | |
| coverageComment += '\n**Target:** >80% coverage\n'; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: coverageComment | |
| }).catch(err => { | |
| console.log('Could not post coverage comment:', err); | |
| }); | |
| - name: Upload Coverage Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 30 | |
| - name: Check Coverage Threshold | |
| if: always() | |
| run: | | |
| echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Target Coverage: >80%" >> $GITHUB_STEP_SUMMARY | |
| echo "Statements: ${{ steps.coverage.outputs.statements }}%" >> $GITHUB_STEP_SUMMARY | |
| echo "Branches: ${{ steps.coverage.outputs.branches }}%" >> $GITHUB_STEP_SUMMARY | |
| echo "Functions: ${{ steps.coverage.outputs.functions }}%" >> $GITHUB_STEP_SUMMARY | |
| echo "Lines: ${{ steps.coverage.outputs.lines }}%" >> $GITHUB_STEP_SUMMARY | |
| results: | |
| name: Test Results Summary | |
| runs-on: ubuntu-latest | |
| needs: [lint, typecheck, unit-tests, integration-tests, coverage] | |
| if: always() | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Download All Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test-artifacts/ | |
| - name: Generate Final Report | |
| run: | | |
| echo "## Test Pipeline Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Job Status" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Lint & Code Quality**: ${{ needs.lint.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Type Checking**: ${{ needs.typecheck.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Unit Tests**: ${{ needs.unit-tests.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Integration Tests**: ${{ needs.integration-tests.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Coverage Report**: ${{ needs.coverage.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Artifacts" >> $GITHUB_STEP_SUMMARY | |
| echo "Test results and reports have been uploaded for review." >> $GITHUB_STEP_SUMMARY | |
| - name: Set Final Status | |
| if: | | |
| needs.lint.result == 'failure' || | |
| needs.typecheck.result == 'failure' || | |
| needs.unit-tests.result == 'failure' || | |
| needs.integration-tests.result == 'failure' | |
| run: exit 1 | |
| - name: Success Notification | |
| if: success() | |
| run: | | |
| echo "✅ All tests passed successfully!" |