Skip to content

Commit

Permalink
Add CI tests targeting Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Sep 11, 2021
1 parent a865f9b commit 81e54ea
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,39 @@ jobs:

- name: Run tests
run: swift test -v --enable-code-coverage

# originally from: https://github.com/compnerd/swift-build/blob/master/.github/workflows/swift-argument-parser.yml
test-windows:
runs-on: windows-latest

strategy:
matrix:
include:
- tag: 5.4.3-RELEASE
branch: swift-5.4.3-release

steps:
- uses: actions/checkout@v2

- name: Install Swift ${{ matrix.tag }}
run: |
function Update-EnvironmentVariables {
foreach ($level in "Machine", "User") {
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
# For Path variables, append the new values, if they're not already in there
if ($_.Name -Match 'Path$') {
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
}
$_
} | Set-Content -Path { "Env:$($_.Name)" }
}
}
Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
Update-EnvironmentVariables
# Reset Path and environment
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
- name: Run tests
run: swift test -v --enable-test-discovery
1 change: 0 additions & 1 deletion Tests/ReportingTests/LintResultsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ final class LintResultsTests: XCTestCase {
XCTAssert(encodedString.contains(#""discoverDate" : "2001-01-01T01:00:00Z","#))
XCTAssert(encodedString.contains(#""matchedString" : "A""#))
XCTAssert(encodedString.contains(#""filePath" : "\/some\/path""#))
XCTAssert(encodedString.contains(#""discoverDate" : "2001-01-01T02:00:00Z","#))

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

0 comments on commit 81e54ea

Please sign in to comment.