3232 env :
3333 TEST_MODE : ${{ inputs.test-mode }}
3434 TEST_NODEIDS : ${{ inputs.test-nodeids }}
35+ PYTEST_WORKERS : 4
3536 steps :
37+ - name : Set up swap space
38+ uses : pierotofy/set-swap-space@master
39+ with :
40+ swap-size-gb : 10
41+
3642 - uses : actions/checkout@v6
3743 with :
3844 fetch-depth : 0
@@ -62,10 +68,16 @@ jobs:
6268 IS_PR : ${{ github.event_name == 'pull_request' }}
6369 TEST_MODE : ${{ inputs.test-mode }}
6470 TEST_NODEIDS : ${{ inputs.test-nodeids }}
71+ PYTEST_WORKERS : 4
6572 defaults :
6673 run :
6774 shell : bash -el {0}
6875 steps :
76+ - name : Set up swap space
77+ uses : pierotofy/set-swap-space@master
78+ with :
79+ swap-size-gb : 10
80+
6981 - uses : actions/checkout@v6
7082
7183 - uses : mamba-org/setup-micromamba@v2.0.7
@@ -138,7 +150,7 @@ jobs:
138150 echo "No valid nodeids found on base; skipping baseline generation."
139151 exit 0
140152 else
141- pytest -n auto --tb=short --disable-warnings -W ignore \
153+ pytest -n ${PYTEST_WORKERS} --dist loadfile --tb=short --disable-warnings -W ignore \
142154 --mpl-generate-path=./ultraplot/tests/baseline/ \
143155 --mpl-default-style="./ultraplot.yml" \
144156 ${FILTERED_NODEIDS} || status=$?
@@ -149,7 +161,7 @@ jobs:
149161 fi
150162 exit "$status"
151163 else
152- pytest -n auto --tb=short --disable-warnings -W ignore \
164+ pytest -n ${PYTEST_WORKERS} --dist loadfile --tb=short --disable-warnings -W ignore \
153165 --mpl-generate-path=./ultraplot/tests/baseline/ \
154166 --mpl-default-style="./ultraplot.yml" \
155167 ultraplot/tests
@@ -188,7 +200,7 @@ jobs:
188200 echo "No valid nodeids found on PR branch; skipping image comparison."
189201 exit 0
190202 else
191- pytest -n auto --tb=short --disable-warnings -W ignore \
203+ pytest -n ${PYTEST_WORKERS} --dist loadfile --tb=short --disable-warnings -W ignore \
192204 --mpl \
193205 --mpl-baseline-path=./ultraplot/tests/baseline \
194206 --mpl-results-path=./results/ \
@@ -202,7 +214,7 @@ jobs:
202214 fi
203215 exit "$status"
204216 else
205- pytest -n auto --tb=short --disable-warnings -W ignore \
217+ pytest -n ${PYTEST_WORKERS} --dist loadfile --tb=short --disable-warnings -W ignore \
206218 --mpl \
207219 --mpl-baseline-path=./ultraplot/tests/baseline \
208220 --mpl-results-path=./results/ \
0 commit comments