Merge branch 'type-everything' #21
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: Code Analysis Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| # Run daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup ast-grep | |
| uses: ./.github/actions/setup-ast-grep | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest pytest-cov | |
| - name: Run unit tests | |
| run: | | |
| python scripts/run_tests.py --unit-only | |
| - name: Run integration tests | |
| run: | | |
| python scripts/run_tests.py --integration-only | |
| - name: Generate coverage report | |
| run: | | |
| coverage report | |
| coverage html | |
| - name: Upload coverage to artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: htmlcov/ | |
| benchmark: | |
| name: Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup ast-grep | |
| uses: ./.github/actions/setup-ast-grep | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest | |
| - name: Run performance benchmarks | |
| run: | | |
| python tests/performance/benchmark_suite.py | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: performance-report | |
| path: performance_report.json | |
| analyze: | |
| name: Code Analysis | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup ast-grep | |
| uses: ./.github/actions/setup-ast-grep | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run code quality analysis | |
| run: | | |
| python -m src.analyzers.code_quality src/ \ | |
| --json quality_report.json \ | |
| --text quality_report.txt | |
| - name: Run test coverage analysis | |
| run: | | |
| python -m src.analyzers.test_coverage src/ \ | |
| --test-dir tests/ \ | |
| --json coverage_report.json \ | |
| --parallel \ | |
| --cache | |
| - name: Run dependency analysis | |
| run: | | |
| python -m src.analyzers.dependencies src/ \ | |
| --json dependency_report.json \ | |
| --detect-circular \ | |
| --parallel \ | |
| --cache | |
| - name: Upload analysis reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: analysis-reports | |
| path: | | |
| quality_report.json | |
| quality_report.txt | |
| coverage_report.json | |
| dependency_report.json | |
| dashboard: | |
| name: Generate Dashboard | |
| runs-on: ubuntu-latest | |
| needs: analyze | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup ast-grep | |
| uses: ./.github/actions/setup-ast-grep | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Download analysis reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: analysis-reports | |
| - name: Generate schemas | |
| run: | | |
| python -m src.generators.schema --root src/ | |
| - name: Generate dashboard | |
| run: | | |
| python -m src.generators.dashboard \ | |
| --schemas schemas_enhanced.json \ | |
| --quality quality_report.json \ | |
| --coverage coverage_report.json \ | |
| --dependency dependency_report.json \ | |
| --output dashboard.html | |
| - name: Upload dashboard | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dashboard | |
| path: dashboard.html | |
| - name: Deploy to GitHub Pages (optional) | |
| if: github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: . | |
| publish_branch: gh-pages | |
| keep_files: false | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| commit_message: 'Update analysis dashboard' |