feat(ci): add AI Contribution Report workflow #206
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 - Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| FORCE_COLOR: "1" | |
| jobs: | |
| test: | |
| name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| runs-on: ${{ matrix.os }} | |
| # Hard cap per matrix job — bail out fast on real hangs instead of | |
| # burning CI minutes up to the GitHub-default 6h ceiling. | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Enable long paths on Windows | |
| if: runner.os == 'Windows' | |
| run: git config --system core.longpaths true | |
| - name: Install poetry | |
| run: pipx install poetry==2.4.1 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: setup-python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| cache: "poetry" | |
| python-version: ${{ matrix.python-version }} | |
| cache-dependency-path: "poetry.lock" | |
| - name: Select matrix Python for Poetry | |
| run: | | |
| poetry env use "${{ steps.setup-python.outputs.python-path }}" | |
| - name: Install invoke | |
| run: pipx install invoke | |
| - name: Install Dependencies | |
| run: invoke install | |
| - name: Verify Poetry Python version | |
| run: | | |
| poetry run python -c " | |
| import sys | |
| expected = tuple(map(int, '${{ matrix.python-version }}'.split('.'))) | |
| actual = sys.version_info[:len(expected)] | |
| print('Python:', sys.version) | |
| assert actual == expected, f'Expected Python {expected}, got {actual}' | |
| " | |
| - name: Validate Types | |
| if: always() | |
| run: invoke type-check | |
| - name: Run Tests | |
| if: always() | |
| run: invoke test-report-xml |