feat: Intelligent Resource Management and Agent Deployment System #74
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: Claude Flow Migration Tests | |
| on: | |
| push: | |
| branches: [ main, claude-flow-v2.0.0 ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| local-tests: | |
| name: Local Execution Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node: [18, 20] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run local execution tests | |
| run: node test/migration/local/test-local-execution.js | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: local-test-results-${{ matrix.os }}-node${{ matrix.node }} | |
| path: test/migration/local/local-test-results.json | |
| remote-npx-tests: | |
| name: Remote NPX Tests | |
| runs-on: ubuntu-latest | |
| needs: local-tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build || echo "No build step" | |
| - name: Create npm package | |
| run: npm pack | |
| - name: Run remote NPX tests | |
| run: node test/migration/remote/test-remote-npx.js | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: remote-npx-test-results | |
| path: test/migration/remote/remote-npx-test-results.json | |
| docker-tests: | |
| name: Docker Tests | |
| runs-on: ubuntu-latest | |
| needs: local-tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Run Docker tests | |
| run: node test/migration/docker/test-docker-execution.js | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-test-results | |
| path: test/migration/docker/docker-test-results.json | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [local-tests, remote-npx-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| npm install -g ruv-swarm | |
| - name: Run integration tests | |
| run: node test/migration/integration/test-integration.js | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-test-results | |
| path: test/migration/integration/integration-test-results.json | |
| performance-tests: | |
| name: Performance Tests | |
| runs-on: ubuntu-latest | |
| needs: local-tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run performance tests | |
| run: node test/migration/performance/test-performance.js | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: performance-test-results | |
| path: test/migration/performance/performance-test-results.json | |
| - name: Comment PR with performance results | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const results = JSON.parse( | |
| fs.readFileSync('test/migration/performance/performance-test-results.json', 'utf8') | |
| ); | |
| const comment = `## Performance Test Results | |
| Average operation time: ${results.avgDuration}ms | |
| Memory usage: ${results.memoryUsage.heapUsed}MB | |
| | Test | Duration | Threshold | Status | | |
| |------|----------|-----------|--------| | |
| ${results.tests.map(t => | |
| `| ${t.name} | ${t.duration || 'N/A'}ms | ${t.threshold || 'N/A'}ms | ${ | |
| t.status === 'passed' ? '✅' : '❌' | |
| } |` | |
| ).join('\n')} | |
| `; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }); | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [local-tests, remote-npx-tests, docker-tests, integration-tests, performance-tests] | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test-artifacts | |
| - name: Generate test summary | |
| run: | | |
| echo "# Claude Flow Migration Test Summary" > test-summary.md | |
| echo "" >> test-summary.md | |
| echo "## Test Results" >> test-summary.md | |
| echo "" >> test-summary.md | |
| # Process all test results | |
| for file in test-artifacts/*/*-results.json; do | |
| if [ -f "$file" ]; then | |
| echo "### $(basename $(dirname $file))" >> test-summary.md | |
| node -e " | |
| const results = require('./$file'); | |
| console.log('- Passed:', results.passed || 0); | |
| console.log('- Failed:', results.failed || 0); | |
| console.log(''); | |
| " >> test-summary.md | |
| fi | |
| done | |
| cat test-summary.md | |
| - name: Upload test summary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-summary | |
| path: test-summary.md |