Visitar URL original
perf(python_unit_tests): use the runner's local disk for temp files o… · apify/workflows@c643cf7 · GitHub
Skip to content

Commit c643cf7

Browse files
authored
perf(python_unit_tests): use the runner's local disk for temp files on Windows (#323)
On Windows runners, `python_unit_tests` now sets `TMP` and `TEMP` to `RUNNER_TEMP` for the rest of the job. The default temp dir is on a network-backed disk that is 4-6x slower at small-file writes than the runner's local SSD. pytest's `tmp_path` and uv's scratch files both honor `TEMP`, so they land on the fast disk. Measured in apify/actor-templates#907. Nothing changes on Linux or macOS. This workflow runs the Windows legs of crawlee-python, apify-sdk-python, apify-client-python and apify-shared-python. apify/actions#41 is the same change for the pnpm side.
1 parent 11e38c9 commit c643cf7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎.github/workflows/python_unit_tests.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ jobs:
6969
- name: Checkout repository
7070
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
7171

72+
# The default Windows temp dir is a network disk, ~5x slower at small files than RUNNER_TEMP (apify/actor-templates#907).
73+
- name: Use the runner's local disk for temp files
74+
if: runner.os == 'Windows'
75+
shell: bash
76+
run: |
77+
echo "TMP=$RUNNER_TEMP" >> "$GITHUB_ENV"
78+
echo "TEMP=$RUNNER_TEMP" >> "$GITHUB_ENV"
79+
7280
- name: Set up Python ${{ matrix.python-version }}
7381
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
7482
with:

0 commit comments

Comments
 (0)