8383 strategy :
8484 fail-fast : true
8585 matrix :
86- python : [' 3.10' , "3.11", "3.12", "3.13", "3.14"]
86+ python : [" 3.10" , "3.11", "3.12", "3.13", "3.14", "3.15 "]
8787 package_shard : ${{ fromJson(needs.initialize.outputs.matrix) }}
8888 name : ${{ matrix.package_shard.is_sharded && format('unit ({0}, {1})', matrix.python, matrix.package_shard.name) || format('unit ({0})', matrix.python) }}
8989 steps :
@@ -100,10 +100,38 @@ jobs:
100100 with :
101101 python-version : ${{ matrix.python }}
102102 cache : ' pip'
103+ allow-prereleases : true
104+ - name : Setup uv
105+ uses : astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
106+ with :
107+ enable-cache : true
108+ cache-dependency-glob : ' packages/**/testing/constraints*.txt'
103109 - name : Install nox
104110 run : |
105111 python -m pip install --upgrade setuptools pip wheel
106112 python -m pip install nox uv
113+ - name : Run unit tests
114+ uv pip install --system nox nox-uv
115+ # Caches compiled wheels locally to prevent building heavy libraries
116+ # such as grpcio, which we build from scratch on every run for Python 3.15+.
117+ # Follow https://github.com/grpc/grpc/issues/41010 for updates.
118+ - name : Cache Built Python 3.15 Wheels
119+ if : matrix.python == '3.15'
120+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
121+ with :
122+ path : .uv-wheel-cache
123+ key : ${{ runner.os }}-uv-wheels-3.15-${{ hashFiles('packages/**/testing/constraints*.txt') }}
124+ restore-keys : |
125+ ${{ runner.os }}-uv-wheels-3.15-
126+ # Pre-cache heavy dependencies sequentially before running parallel tests
127+ - name : Pre-cache heavy dependencies (grpcio)
128+ if : matrix.python == '3.15'
129+ run : |
130+ # Create the directory so uv doesn't crash if there is a `cache miss`
131+ mkdir -p .uv-wheel-cache
132+ # Download and compile grpcio sequentially so that parallel test workers
133+ # immediately hit the warm cache instead of deadlocking on compilation.
134+ uv pip install --system grpcio --find-links .uv-wheel-cache
107135 - name : Run unit tests for ${{ matrix.package_shard.description }}
108136 env :
109137 BUILD_TYPE : presubmit
0 commit comments