From ed72f7594954ff73cdd62188dc98335cbbf4f34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Thu, 10 Sep 2026 12:03:36 +0200 Subject: [PATCH] perf(python_unit_tests): use the runner's local disk for temp files on Windows The default Windows temp dir sits on a network-backed disk that is 4-6x slower at small-file writes than the local SSD behind RUNNER_TEMP. pytest's tmp_path and uv's scratch files honor TEMP, so point it there for the rest of the job. Measured on apify/actor-templates#907. No-op on Linux and macOS. --- .github/workflows/python_unit_tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/python_unit_tests.yaml b/.github/workflows/python_unit_tests.yaml index ae1d8def..bad24106 100644 --- a/.github/workflows/python_unit_tests.yaml +++ b/.github/workflows/python_unit_tests.yaml @@ -69,6 +69,14 @@ jobs: - name: Checkout repository uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + # The default Windows temp dir is a network disk, ~5x slower at small files than RUNNER_TEMP (apify/actor-templates#907). + - name: Use the runner's local disk for temp files + if: runner.os == 'Windows' + shell: bash + run: | + echo "TMP=$RUNNER_TEMP" >> "$GITHUB_ENV" + echo "TEMP=$RUNNER_TEMP" >> "$GITHUB_ENV" + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: