Skip to content

Commit f400e00

Browse files
committed
Fix docker-less script execution
1 parent e2753fa commit f400e00

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,24 @@ jobs:
126126
- name: Install Visual Studio Build Tools
127127
if: ${{ !inputs.enable_windows_docker }}
128128
run: |
129-
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/install-vsb.ps1 -OutFile install-vsb.ps1
130-
. .\install-vsb.ps1
131-
del .\install-vsb.ps1
129+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/install-vsb.ps1 -OutFile $env:TEMP\install-vsb.ps1
130+
. $env:TEMP\install-vsb.ps1
131+
del $env:TEMP\install-vsb.ps1
132132
- name: Install Swift
133133
if: ${{ !inputs.enable_windows_docker }}
134134
run: |
135-
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift.ps1 -OutFile install-swift.ps1
136-
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift-${{ matrix.swift_version }}.ps1 -OutFile install-swift-${{ matrix.swift_version }}.ps1
137-
. .\install-swift-${{ matrix.swift_version }}.ps1
138-
del .\install-swift*.ps1
135+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift.ps1 -OutFile $env:TEMP\install-swift.ps1
136+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/award999/github-workflows/refs/heads/dockerless-windows/.github/workflows/scripts/windows/swift/install-swift-${{ matrix.swift_version }}.ps1 -OutFile $env:TEMP\install-swift-${{ matrix.swift_version }}.ps1
137+
. $env:TEMP\install-swift-${{ matrix.swift_version }}.ps1
138+
del $env:TEMP\install-swift*.ps1
139139
- name: Create test script
140140
run: |
141141
mkdir $env:TEMP\test-script
142+
if ("${{ inputs.enable_windows_docker }}" -eq "true") {
143+
$Source = C:\source
144+
} else {
145+
$Source = $env:GITHUB_WORKSPACE
146+
}
142147
echo @'
143148
Set-PSDebug -Trace 1
144149
@@ -152,12 +157,12 @@ jobs:
152157
}
153158
Invoke-Program swift --version
154159
Invoke-Program swift test --version
155-
Invoke-Program cd C:\source\
160+
Invoke-Program cd $Source
156161
${{ inputs.windows_pre_build_command }}
157162
Invoke-Program ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
158163
'@ >> $env:TEMP\test-script\run.ps1
159164
# Docker build
160-
- name: Build / Test
165+
- name: Docker Build / Test
161166
timeout-minutes: 60
162167
if: ${{ inputs.enable_windows_docker }}
163168
run: |
@@ -166,4 +171,7 @@ jobs:
166171
- name: Build / Test
167172
timeout-minutes: 60
168173
if: ${{ !inputs.enable_windows_docker }}
169-
run: powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1
174+
run: |
175+
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
176+
RefreshEnv
177+
powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1; exit $LastExitCode

0 commit comments

Comments
 (0)