2929 matrix : ${{ steps.set-matrix.outputs.matrix }}
3030 is_full_run : ${{ steps.check-label.outputs.is_full_run }}
3131 env :
32- MAX_SHARDS : 16
32+ MAX_SHARDS : 20
3333 # Define weights for long-running unit tests to balance shard execution time
3434 # Each weight is roughly 1 minute of expected execution time
3535 # Default for unset packages is 1
8181 if : needs.initialize.outputs.matrix != '[]' && needs.initialize.outputs.matrix != ''
8282 runs-on : ubuntu-22.04
8383 strategy :
84- fail-fast : true
8584 matrix :
86- python : [' 3.10' , "3.11", "3.12", "3.13", "3.14"]
85+ python : [" 3.10" , "3.11", "3.12", "3.13", "3.14", "3.15 "]
8786 package_shard : ${{ fromJson(needs.initialize.outputs.matrix) }}
8887 name : ${{ matrix.package_shard.is_sharded && format('unit ({0}, {1})', matrix.python, matrix.package_shard.name) || format('unit ({0})', matrix.python) }}
8988 steps :
@@ -100,10 +99,43 @@ jobs:
10099 with :
101100 python-version : ${{ matrix.python }}
102101 cache : ' pip'
102+ allow-prereleases : true
103+ - name : Setup uv
104+ uses : astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
105+ with :
106+ enable-cache : true
107+ cache-dependency-glob : ' packages/**/testing/constraints*.txt'
103108 - name : Install nox
104109 run : |
105110 python -m pip install --upgrade setuptools pip wheel
106111 python -m pip install nox uv
112+ - name : Run unit tests
113+ run : |
114+ uv pip install --system nox nox-uv
115+ # Caches local wheels for Python 3.15+ to avoid repeatedly downloading or building heavy libraries.
116+ # Follow https://github.com/grpc/grpc/issues/41010 for updates.
117+ - name : Cache Built Python 3.15 Wheels
118+ if : matrix.python == '3.15'
119+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
120+ with :
121+ path : .uv-wheel-cache
122+ key : ${{ runner.os }}-uv-wheels-3.15-${{ hashFiles('packages/**/testing/constraints*.txt') }}
123+ restore-keys : |
124+ ${{ runner.os }}-uv-wheels-3.15-
125+ # TODO: Remove this step once official Python 3.15 wheels for grpcio are published to PyPI.
126+ # See https://github.com/grpc/grpc/issues/41010#issuecomment-4848264910 for details.
127+ - name : Install grpcio wheel for Python 3.15
128+ if : matrix.python == '3.15'
129+ run : |
130+ mkdir -p .uv-wheel-cache
131+ WHEEL_FILE=".uv-wheel-cache/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"
132+ if [ ! -f "$WHEEL_FILE" ]; then
133+ curl -L "https://packages.grpc.io/archive/2026/06/5ccdab32010f762634e1082d19be53cf60458456-b37e49c7-5e62-4cbe-870a-c599bb907b04/python/grpcio/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl" -o "$WHEEL_FILE"
134+ fi
135+ echo "d7706633cd5d97a8b8d3c6ed36c5940722a9b5cbb47f0d10bc433ee27af36ff0 $WHEEL_FILE" | sha256sum -c
136+ uv pip install --system "$WHEEL_FILE"
137+ echo "UV_FIND_LINKS=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
138+ echo "UV_CACHE_DIR=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
107139 - name : Run unit tests for ${{ matrix.package_shard.description }}
108140 env :
109141 BUILD_TYPE : presubmit
0 commit comments