Skip to content

Commit d65f36f

Browse files
committed
Fix docker-less script execution
1 parent c8b2c80 commit d65f36f

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ jobs:
108108
- name: Checkout repository
109109
uses: actions/checkout@v4
110110
with:
111-
ref: ${{ github.ref }} # Include changes to the target branch when action is re-run https://github.com/actions/checkout/issues/1036=
112-
- name: Set environment variables
111+
ref: ''
113112
if: ${{ inputs.windows_env_vars }}
114113
run: |
115114
$lines = "${{ inputs.windows_env_vars }}" -split "`r`n"
@@ -130,19 +129,24 @@ jobs:
130129
- name: Install Visual Studio Build Tools
131130
if: ${{ !inputs.enable_windows_docker }}
132131
run: |
133-
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
134-
. .\install-vsb.ps1
135-
del .\install-vsb.ps1
132+
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
133+
. $env:TEMP\install-vsb.ps1
134+
del $env:TEMP\install-vsb.ps1
136135
- name: Install Swift
137136
if: ${{ !inputs.enable_windows_docker }}
138137
run: |
139-
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
140-
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
141-
. .\install-swift-${{ matrix.swift_version }}.ps1
142-
del .\install-swift*.ps1
138+
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
139+
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
140+
. $env:TEMP\install-swift-${{ matrix.swift_version }}.ps1
141+
del $env:TEMP\install-swift*.ps1
143142
- name: Create test script
144143
run: |
145144
mkdir $env:TEMP\test-script
145+
if (${{ inputs.enable_windows_docker }}) {
146+
$Source = C:\source
147+
} else {
148+
$Source = env:GITHUB_WORKSPACE
149+
}
146150
echo @'
147151
Set-PSDebug -Trace 1
148152
@@ -156,12 +160,12 @@ jobs:
156160
}
157161
Invoke-Program swift --version
158162
Invoke-Program swift test --version
159-
Invoke-Program cd C:\source\
163+
Invoke-Program cd $Source
160164
${{ inputs.windows_pre_build_command }}
161165
Invoke-Program ${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
162166
'@ >> $env:TEMP\test-script\run.ps1
163167
# Docker build
164-
- name: Build / Test
168+
- name: Docker Build / Test
165169
timeout-minutes: 60
166170
if: ${{ inputs.enable_windows_docker }}
167171
run: |
@@ -170,4 +174,4 @@ jobs:
170174
- name: Build / Test
171175
timeout-minutes: 60
172176
if: ${{ !inputs.enable_windows_docker }}
173-
run: powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1
177+
run: . $env:TEMP\test-script\run.ps1

0 commit comments

Comments
 (0)