Skip to content

Use Powershell to run tests on Windows #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
20 changes: 9 additions & 11 deletions .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ['5.9', '6.0', 'nightly', 'nightly-6.0']
swift_version: ['5.9', '5.10', '6.0', 'nightly', 'nightly-6.0']
exclude:
- ${{ fromJson(inputs.windows_exclude_swift_versions) }}
steps:
Expand All @@ -103,18 +103,16 @@ jobs:
- name: Create test script
run: |
mkdir $env:TEMP\test-script
echo 'Set-PSDebug -Trace 1' >> $env:TEMP\test-script\run.ps1
echo '$ErrorActionPreference = "Stop"' >> $env:TEMP\test-script\run.ps1
echo 'swift --version' >> $env:TEMP\test-script\run.ps1
echo 'swift test --version' >> $env:TEMP\test-script\run.ps1
echo 'cd C:\source\' >> $env:TEMP\test-script\run.ps1
echo @'
Set-PSDebug -Trace 1
$ErrorActionPreference = "Stop"
${{ inputs.windows_pre_build_command }}
'@ >> $env:TEMP\test-script\pre-build.ps1
echo 'swift --version || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
echo 'swift test --version || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
echo 'cd C:\source\ || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
echo 'powershell.exe -NoLogo -File C:\test-script\pre-build.ps1 || (exit /b 1)' >> $env:TEMP\test-script\run.cmd
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
'@ >> $env:TEMP\test-script\run.ps1
echo '${{ inputs.windows_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}' >> $env:TEMP\test-script\run.ps1
- name: Build / Test
timeout-minutes: 60
run: |
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
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