Skip to content

Commit d595cd2

Browse files
Copilotstrawgate
andauthored
Reduce xdist worker count to 2 on Windows (#243)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: strawgate <[email protected]>
1 parent 20e58e0 commit d595cd2

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,30 @@ jobs:
141141
- name: "Install uv"
142142
uses: astral-sh/setup-uv@v6
143143

144+
- name: "Set pytest worker count"
145+
id: pytest-workers
146+
run: |
147+
if [ "$RUNNER_OS" == "Windows" ]; then
148+
echo "count=2" >> $GITHUB_OUTPUT
149+
else
150+
echo "count=auto" >> $GITHUB_OUTPUT
151+
fi
152+
shell: bash
153+
144154
- name: "Install latest dependencies"
145155
run: uv sync --locked --group dev --python ${{ matrix.python-version }}
146156
working-directory: ${{ matrix.project }}
147157

148158
- name: "Test with latest dependencies"
149-
run: uv run pytest tests . -vv
159+
run: uv run pytest tests . -vv -n ${{ steps.pytest-workers.outputs.count }}
150160
working-directory: ${{ matrix.project }}
151161

152162
- name: "Install oldest dependencies"
153163
run: uv sync --group dev --python ${{ matrix.python-version }} --resolution lowest-direct
154164
working-directory: ${{ matrix.project }}
155165

156166
- name: "Test with oldest dependencies"
157-
run: uv run pytest tests . -vv
167+
run: uv run pytest tests . -vv -n ${{ steps.pytest-workers.outputs.count }}
158168
working-directory: ${{ matrix.project }}
159169

160170
- name: "Build"
@@ -192,20 +202,30 @@ jobs:
192202
- name: "Install uv"
193203
uses: astral-sh/setup-uv@v6
194204

205+
- name: "Set pytest worker count"
206+
id: pytest-workers
207+
run: |
208+
if [ "$RUNNER_OS" == "Windows" ]; then
209+
echo "count=2" >> $GITHUB_OUTPUT
210+
else
211+
echo "count=auto" >> $GITHUB_OUTPUT
212+
fi
213+
shell: bash
214+
195215
- name: "Install latest dependencies"
196216
run: uv sync --locked --group dev --python ${{ matrix.python-version }}
197217
working-directory: ${{ matrix.project }}
198218

199219
- name: "Test with latest dependencies"
200-
run: uv run pytest tests . -vv
220+
run: uv run pytest tests . -vv -n ${{ steps.pytest-workers.outputs.count }}
201221
working-directory: ${{ matrix.project }}
202222

203223
- name: "Install oldest dependencies"
204224
run: uv sync --group dev --python ${{ matrix.python-version }} --resolution lowest-direct
205225
working-directory: ${{ matrix.project }}
206226

207227
- name: "Test with oldest dependencies"
208-
run: uv run pytest tests . -vv
228+
run: uv run pytest tests . -vv -n ${{ steps.pytest-workers.outputs.count }}
209229
working-directory: ${{ matrix.project }}
210230

211231
- name: "Build"

0 commit comments

Comments
 (0)