Repository navigation
[pre-commit.ci] pre-commit autoupdate #342
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: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| test: | |
| name: "Test (Python ${{ matrix.python-version }})" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| env: | |
| COVERAGE_FILE: .coverage.py${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv pip install \ | |
| pydantic pyyaml jinja2 soundfile numpy scipy \ | |
| click rich jsonlines \ | |
| pyroomacoustics \ | |
| librosa pyloudnorm \ | |
| pytest pytest-asyncio pytest-cov | |
| - name: Install package | |
| run: uv pip install --no-deps -e . | |
| - name: Run tests | |
| run: .venv/bin/pytest tests/ -v --tb=short --cov synthbanshee --cov-report= | |
| - name: Upload raw coverage artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr-agent-context-coverage-py${{ matrix.python-version }} | |
| path: .coverage* | |
| include-hidden-files: true | |
| if-no-files-found: ignore | |
| lint: | |
| name: "Lint & type-check" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| python-version: "3.12" | |
| - name: Install lint dependencies | |
| run: uv pip install ruff mypy pydantic types-PyYAML | |
| - name: Install package | |
| run: uv pip install --no-deps -e . | |
| - name: ruff check | |
| run: .venv/bin/ruff check . | |
| - name: ruff format (check only) | |
| run: .venv/bin/ruff format --check . | |
| - name: mypy | |
| run: .venv/bin/mypy synthbanshee/ --ignore-missing-imports | |
| coverage: | |
| name: "Combine coverage & generate XML" | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| python-version: "3.11" | |
| - name: Install coverage | |
| run: uv pip install coverage[toml] | |
| - name: Download raw coverage artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: pr-agent-context-coverage-* | |
| path: coverage-data | |
| merge-multiple: true | |
| - name: Combine coverage and generate XML | |
| run: | | |
| .venv/bin/coverage combine coverage-data/ | |
| .venv/bin/coverage report | |
| .venv/bin/coverage xml | |
| - name: Upload combined coverage XML | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml | |
| if-no-files-found: warn | |
| pr-agent-context: | |
| name: "PR agent context" | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| needs: [lint, test, coverage] | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| uses: shaypal5/pr-agent-context/.github/workflows/pr-agent-context.yml@v4 | |
| with: | |
| tool_ref: v4 | |
| target_patch_coverage: "100" | |
| include_review_comments: true | |
| include_failing_checks: true | |
| include_failed_step_output: true | |
| include_patch_coverage: true | |
| coverage_artifact_prefix: pr-agent-context-coverage | |
| prompt_template_file: .github/pr-agent-context-template.md | |
| debug_artifacts: true |