Skip to content

Commit 81e54ea

Browse files
committed
Add CI tests targeting Windows platform
1 parent a865f9b commit 81e54ea

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/pull-request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,39 @@ jobs:
4343

4444
- name: Run tests
4545
run: swift test -v --enable-code-coverage
46+
47+
# originally from: https://github.com/compnerd/swift-build/blob/master/.github/workflows/swift-argument-parser.yml
48+
test-windows:
49+
runs-on: windows-latest
50+
51+
strategy:
52+
matrix:
53+
include:
54+
- tag: 5.4.3-RELEASE
55+
branch: swift-5.4.3-release
56+
57+
steps:
58+
- uses: actions/checkout@v2
59+
60+
- name: Install Swift ${{ matrix.tag }}
61+
run: |
62+
function Update-EnvironmentVariables {
63+
foreach ($level in "Machine", "User") {
64+
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
65+
# For Path variables, append the new values, if they're not already in there
66+
if ($_.Name -Match 'Path$') {
67+
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
68+
}
69+
$_
70+
} | Set-Content -Path { "Env:$($_.Name)" }
71+
}
72+
}
73+
74+
Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
75+
Update-EnvironmentVariables
76+
# Reset Path and environment
77+
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
78+
Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
79+
80+
- name: Run tests
81+
run: swift test -v --enable-test-discovery

Tests/ReportingTests/LintResultsTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ final class LintResultsTests: XCTestCase {
334334
XCTAssert(encodedString.contains(#""discoverDate" : "2001-01-01T01:00:00Z","#))
335335
XCTAssert(encodedString.contains(#""matchedString" : "A""#))
336336
XCTAssert(encodedString.contains(#""filePath" : "\/some\/path""#))
337-
XCTAssert(encodedString.contains(#""discoverDate" : "2001-01-01T02:00:00Z","#))
338337

339338
let decodedLintResults = try JSONDecoder.iso.decode(LintResults.self, from: encodedData)
340339
XCTAssertNoDifference(decodedLintResults, lintResults)

0 commit comments

Comments
 (0)