-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Motivation In the long term we want to add support for Windows in our Swift packages. To do this we need a CI setup to ensure that our packages are building and the tests are passing. # Modification This PR adds a windows job to our swift matrix that installs Swift on the runner and then uses Swift PM to build and test the package. Windows jobs are disabled by default since most of our packages require some work to add Windows support. # Result We have a Windows CI pipeline that allows us to verify that our packages are working.
- Loading branch information
1 parent
49cd78b
commit 0a5160a
Showing
4 changed files
with
198 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
##===----------------------------------------------------------------------===## | ||
## | ||
## This source file is part of the SwiftNIO open source project | ||
## | ||
## Copyright (c) 2024 Apple Inc. and the SwiftNIO project authors | ||
## Licensed under Apache License v2.0 | ||
## | ||
## See LICENSE.txt for license information | ||
## See CONTRIBUTORS.txt for the list of SwiftNIO project authors | ||
## | ||
## SPDX-License-Identifier: Apache-2.0 | ||
## | ||
##===----------------------------------------------------------------------===## | ||
|
||
# Set strict mode to catch errors | ||
Set-StrictMode -Version Latest | ||
|
||
function Log { | ||
param ( | ||
[string]$Message | ||
) | ||
Write-Host ("** " + $Message) -ForegroundColor Yellow | ||
} | ||
|
||
function Error { | ||
param ( | ||
[string]$Message | ||
) | ||
Write-Host ("** ERROR: " + $Message) -ForegroundColor Red | ||
} | ||
|
||
function Fatal { | ||
param ( | ||
[string]$Message | ||
) | ||
Error $Message | ||
exit 1 | ||
} | ||
|
||
# Check if SWIFT_VERSION is set | ||
if (-not $env:SWIFT_VERSION) { | ||
Fatal "SWIFT_VERSION unset" | ||
} | ||
|
||
# Check if COMMAND is set | ||
if (-not $env:COMMAND) { | ||
Fatal "COMMAND unset" | ||
} | ||
|
||
$swift_version = $env:SWIFT_VERSION | ||
$command = $env:COMMAND | ||
$command_5_9 = $env:COMMAND_OVERRIDE_5_9 | ||
$command_5_10 = $env:COMMAND_OVERRIDE_5_10 | ||
$command_6_0 = $env:COMMAND_OVERRIDE_6_0 | ||
$command_nightly_6_0 = $env:COMMAND_OVERRIDE_NIGHTLY_6_0 | ||
$command_nightly_main = $env:COMMAND_OVERRIDE_NIGHTLY_MAIN | ||
|
||
if ($swift_version -eq "5.9" -and $command_5_9) { | ||
Log "Running 5.9 command override" | ||
Invoke-Expression $command_5_9 | ||
} elseif ($swift_version -eq "5.10" -and $command_5_10) { | ||
Log "Running 5.10 command override" | ||
Invoke-Expression $command_5_10 | ||
} elseif ($swift_version -eq "6.0" -and $command_6_0) { | ||
Log "Running 6.0 command override" | ||
Invoke-Expression $command_6_0 | ||
} elseif ($swift_version -eq "nightly-6.0" -and $command_nightly_6_0) { | ||
Log "Running nightly 6.0 command override" | ||
Invoke-Expression $command_nightly_6_0 | ||
} elseif ($swift_version -eq "nightly-main" -and $command_nightly_main) { | ||
Log "Running nightly main command override" | ||
Invoke-Expression $command_nightly_main | ||
} else { | ||
Log "Running default command" | ||
Invoke-Expression $command | ||
} | ||
|
||
Exit $LASTEXITCODE |