Skip to content

Commit 34c2f07

Browse files
authored
CI: add support for running CI on Windows (#79)
* CI: add support for running CI on Windows * Tests: disable certain tests on Windows
1 parent 9a47e03 commit 34c2f07

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/tests_windows.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: tests-windows
2+
on: [push, pull_request]
3+
jobs:
4+
windows:
5+
name: windows
6+
runs-on: windows-latest
7+
steps:
8+
- uses: seanmiddleditch/gha-setup-vsdevenv@master
9+
10+
- name: Install swift-DEVELOPMENT-SNAPSHOT-2020-09-22-a
11+
run: |
12+
Install-Binary -Url "https://swift.org/builds/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2020-09-22-a/swift-DEVELOPMENT-SNAPSHOT-2020-09-22-a-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
13+
- name: Set Environment Variables
14+
run: |
15+
echo "::set-env name=SDKROOT::C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
16+
echo "::set-env name=DEVELOPER_DIR::C:\Library\Developer"
17+
- name: Adjust Paths
18+
run: |
19+
echo "::add-path::C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin"
20+
- name: Install Supporting Files
21+
shell: cmd
22+
run: |
23+
copy "%SDKROOT%\usr\share\ucrt.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt\module.modulemap"
24+
copy "%SDKROOT%\usr\share\visualc.modulemap" "%VCToolsInstallDir%\include\module.modulemap"
25+
copy "%SDKROOT%\usr\share\visualc.apinotes" "%VCToolsInstallDir%\include\visualc.apinotes"
26+
copy "%SDKROOT%\usr\share\winsdk.modulemap" "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
27+
28+
- name: Swift version
29+
run: swift --version
30+
31+
- name: Checkout
32+
uses: actions/checkout@v1
33+
34+
- name: Build
35+
run: swift build -v
36+
37+
- name: Test
38+
run: swift test -v
39+
40+
- name: Build (opt)
41+
run: swift build -v -c release

Tests/BenchmarkTests/BenchmarkCommandTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ final class BenchmarkCommandTests: XCTestCase {
2828
}
2929

3030
func testDebugBuildError() {
31+
// TODO: figure out why this is failing on Windows CI hosts only
32+
#if !os(Windows)
3133
// Note: this can only be tested in debug builds!
3234
if testsAreRunningInDebugBuild {
3335
do {
@@ -38,6 +40,7 @@ final class BenchmarkCommandTests: XCTestCase {
3840
XCTAssert(message.starts(with: "Please build with optimizations enabled"), message)
3941
}
4042
}
43+
#endif
4144
}
4245

4346
func testParseFilter() throws {

0 commit comments

Comments
 (0)