Skip to content

Commit 43aff0e

Browse files
authored
Merge pull request #47 from ahoppen/windows-5.10
Use Powershell to run tests on Windows
2 parents 1851390 + 1515d4a commit 43aff0e

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

.github/workflows/swift_package_test.yml

+9-11
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
strategy:
8585
fail-fast: false
8686
matrix:
87-
swift_version: ['5.9', '6.0', 'nightly', 'nightly-6.0']
87+
swift_version: ['5.9', '5.10', '6.0', 'nightly', 'nightly-6.0']
8888
exclude:
8989
- ${{ fromJson(inputs.windows_exclude_swift_versions) }}
9090
steps:
@@ -103,18 +103,16 @@ jobs:
103103
- name: Create test script
104104
run: |
105105
mkdir $env:TEMP\test-script
106+
echo 'Set-PSDebug -Trace 1' >> $env:TEMP\test-script\run.ps1
107+
echo '$ErrorActionPreference = "Stop"' >> $env:TEMP\test-script\run.ps1
108+
echo 'swift --version' >> $env:TEMP\test-script\run.ps1
109+
echo 'swift test --version' >> $env:TEMP\test-script\run.ps1
110+
echo 'cd C:\source\' >> $env:TEMP\test-script\run.ps1
106111
echo @'
107-
Set-PSDebug -Trace 1
108-
$ErrorActionPreference = "Stop"
109112
${{ inputs.windows_pre_build_command }}
110-
'@ >> $env:TEMP\test-script\pre-build.ps1
111-
112-
echo 'swift --version || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
113-
echo 'swift test --version || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
114-
echo 'cd C:\source\ || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
115-
echo 'powershell.exe -NoLogo -File C:\test-script\pre-build.ps1 || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
116-
echo '${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
113+
'@ >> $env:TEMP\test-script\run.ps1
114+
echo '${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}' >> $env:TEMP\test-script\run.ps1
117115
- name: Build / Test
118116
timeout-minutes: 60
119117
run: |
120-
docker run -v ${{ github.workspace }}:C:\source -v $env:TEMP\test-script:C:\test-script ${{ steps.pull_docker_image.outputs.image }} C:\test-script\run.cmd
118+
docker run -v ${{ github.workspace }}:C:\source -v $env:TEMP\test-script:C:\test-script ${{ steps.pull_docker_image.outputs.image }} powershell.exe -NoLogo -File C:\test-script\run.ps1

0 commit comments

Comments
 (0)