Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/reusable-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,28 @@ jobs:
WP_CLI_TEST_OBJECT_CACHE: ${{ inputs.object_cache }}

steps:
# The Behat suite is heavily I/O- and process-bound: every scenario
# installs WordPress and spawns many short-lived `wp` processes. On the
# GitHub Windows runner those working files land on the slow C: drive.
# Relocating them to the fast D: drive roughly halves the Behat run time.
# The wp-cli-tests framework derives the WP install dir, all core/install/
# SQLite caches and HOME/COMPOSER_HOME (the WP-CLI cache) from
# sys_get_temp_dir(), and forwards TEMP/TMP to the spawned `wp` processes,
# so pointing TEMP/TMP at D: relocates all of it. Guarded so it is a no-op
# if the D: drive is ever unavailable.
- name: Use the fast D drive for temporary files
if: ${{ startsWith(inputs.os, 'windows') }}
shell: pwsh
run: |
if (Test-Path 'D:\') {
New-Item -ItemType Directory -Force -Path 'D:\Temp' | Out-Null
"TEMP=D:\Temp" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"TMP=D:\Temp" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Write-Host 'Using D:\Temp for temporary files.'
} else {
Write-Host 'D: drive not available; using the default temp location.'
}

- name: Check out source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ jobs:
"php": "8.5",
"wp": "trunk",
"dbtype": "sqlite",
"os": "windows-latest"
"os": "windows-2022"
}
]
}
Expand Down