Skip to content

Commit 22dbd73

Browse files
committed
ci: Cache Windows curl build
1 parent 3aa7f4a commit 22dbd73

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/actions/install-curl/action.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,26 @@ runs:
2929
echo "CURL_ROOT=$(brew --prefix curl)" >> $GITHUB_OUTPUT
3030
3131
# Windows: Build CURL from source with MSVC using helper script
32+
- name: Cache CURL (Windows)
33+
if: runner.os == 'Windows'
34+
id: cache-curl-windows
35+
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
36+
with:
37+
path: 'C:\curl-install'
38+
key: curl-windows-8.11.1-${{ hashFiles('scripts/build-curl-windows.ps1') }}
39+
3240
- name: Install CURL for Windows
3341
if: runner.os == 'Windows'
3442
id: windows-action
3543
shell: pwsh
3644
run: |
37-
# Use the build script from the repository
38-
& "${{ github.workspace }}\scripts\build-curl-windows.ps1" -Version "8.11.1" -InstallPrefix "C:\curl-install"
45+
if ("${{ steps.cache-curl-windows.outputs.cache-hit }}" -ne "true") {
46+
& "${{ github.workspace }}\scripts\build-curl-windows.ps1" -Version "8.11.1" -InstallPrefix "C:\curl-install"
3947
40-
if ($LASTEXITCODE -ne 0) {
41-
Write-Error "CURL build failed"
42-
exit 1
48+
if ($LASTEXITCODE -ne 0) {
49+
Write-Error "CURL build failed"
50+
exit 1
51+
}
4352
}
4453
4554
echo "CURL_ROOT=C:\curl-install" >> $env:GITHUB_OUTPUT

0 commit comments

Comments
 (0)