diff --git a/pnpm-install/README.md b/pnpm-install/README.md index 35ed6c7..97fd3c4 100644 --- a/pnpm-install/README.md +++ b/pnpm-install/README.md @@ -29,3 +29,14 @@ steps: with: github-registry-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_REGISTRY_TOKEN }} ``` + +## Windows runners + +On Windows the action also points `TMP` and `TEMP` at `RUNNER_TEMP` for the rest of the job. The default temp dir lives on a network-backed disk that is several times slower at small-file writes than the runner's local SSD, which matters for anything that unpacks a project or a `node_modules` tree into the temp dir. + +If the job installs Playwright browsers, gate `--with-deps` on Linux. On Windows the flag enables the Media Foundation feature, which takes about three minutes and only adds video codecs: + +```yaml + - name: Install Playwright browsers + run: pnpm exec playwright install chromium ${{ runner.os == 'Linux' && '--with-deps' || '' }} +``` diff --git a/pnpm-install/action.yaml b/pnpm-install/action.yaml index 0310b27..789f490 100644 --- a/pnpm-install/action.yaml +++ b/pnpm-install/action.yaml @@ -32,6 +32,14 @@ runs: with: swap-size-gb: 10 + # 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" + - uses: pnpm/action-setup@v6.0.8 name: Install pnpm with: