Migrate to protobuf-py and rename repo to connect-py #810
Workflow file for this run
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: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| concurrency: | |
| # Cancel in-progress jobs for PRs only | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.sha || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| resolution: ["highest", "lowest-direct"] | |
| os: | |
| - macos-15 | |
| - ubuntu-24.04 | |
| - windows-2025 | |
| python: | |
| - "3.10" | |
| - "3.14" | |
| coverage: | |
| - "nocov" | |
| # Test oldest and newest on all OS's, but others only on one | |
| # to save CI load. | |
| include: | |
| - os: ubuntu-24.04 | |
| python: "3.11" | |
| coverage: "nocov" | |
| resolution: "lowest-direct" | |
| - os: ubuntu-24.04 | |
| python: "3.12" | |
| coverage: "nocov" | |
| resolution: "lowest-direct" | |
| - os: ubuntu-24.04 | |
| python: "3.13" | |
| coverage: "nocov" | |
| resolution: "lowest-direct" | |
| # Enable coverage on just one job | |
| - os: ubuntu-24.04 | |
| python: "3.14" | |
| coverage: "cov" | |
| resolution: "lowest-direct" | |
| env: | |
| # Shared env variables for all the tests | |
| UV_RESOLUTION: "${{ matrix.resolution }}" | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| # For conformance runner | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: "^1.26" | |
| - run: uv sync --frozen | |
| - name: run lints | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| run: uv run poe lint | |
| - name: check running generate does not create a diff | |
| # NOTE: running on macOS as our sed command only works there | |
| # We expect uv.lock to change when matrix.resolution == "lowest-direct", so we don't check it there. | |
| if: ${{ startsWith(matrix.os, 'macos-') && matrix.resolution == 'highest' }} | |
| run: uv run poe checkgenerate | |
| env: | |
| BUF_TOKEN: ${{ secrets.BUF_TOKEN }} | |
| - name: run python tests | |
| run: uv run poe test ${{ matrix.coverage == 'cov' && '--cov=connectrpc --cov-report=xml' || '' }} | |
| - name: run OTel tests | |
| run: uv run poe test-otel ${{ matrix.coverage == 'cov' && '--cov=connectrpc_otel --cov-report=xml' || '' }} | |
| - name: run conformance tests | |
| # TODO: Debug stdin/stdout issues on Windows | |
| if: ${{ !startsWith(matrix.os, 'windows-') }} | |
| run: uv run poe test-conformance ${{ matrix.coverage == 'cov' && '--cov=connectrpc --cov-report=xml' || '' }} | |
| - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| if: ${{ matrix.coverage == 'cov' }} | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| needs: ci | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - run: uv sync --frozen | |
| - run: uv build | |
| # Builds to root dist directory so published together with the main project. | |
| - run: uv build | |
| working-directory: connectrpc-otel | |
| - name: build codegen archives | |
| run: uv build | |
| working-directory: protoc-gen-connectrpc | |
| - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true |