Skip to content

Commit 0c922e2

Browse files
committed
Update coverage.yml
Use gha-setup-swift to configure the coverage CI.
1 parent 69d807d commit 0c922e2

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

.github/workflows/coverage.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,22 @@ jobs:
1818
include:
1919
- branch: development
2020
tag: DEVELOPMENT-SNAPSHOT-2021-07-15-a
21+
options: '-Xmanifest -use-ld=link -Xswiftc -use-ld=link'
2122

2223
steps:
23-
- name: Install Swift ${{ matrix.tag }}
24-
run: |
25-
function Update-EnvironmentVariables {
26-
foreach ($level in "Machine", "User") {
27-
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
28-
# For Path variables, append the new values, if they're not already in there
29-
if ($_.Name -Match 'Path$') {
30-
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -Split ';' | Select -Unique) -Join ';'
31-
}
32-
$_
33-
} | Set-Content -Path { "Env:$($_.Name)" }
34-
}
35-
}
36-
Install-Binary -Url "https://swift.org/builds/${{ matrix.branch }}/windows10/swift-${{ matrix.tag }}/swift-${{ matrix.tag }}-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
37-
Update-EnvironmentVariables
38-
# Reset Path and environment
39-
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
40-
Get-ChildItem Env: | % { echo "$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
24+
- uses: seanmiddleditch/gha-setup-vsdevenv@master
25+
- uses: compnerd/gha-setup-swift@main
26+
with:
27+
tag: ${{ matrix.tag }}
28+
branch: ${{ matrix.branch }}
4129

4230
- uses: actions/checkout@v2
31+
4332
- name: Build
44-
run: swift build
33+
run: swift build ${{ matrix.options }}
34+
4535
- name: Test
46-
run: swift test --enable-code-coverage
36+
run: swift test --enable-code-coverage ${{ matrix.options }}
4737

4838
- name: Process Coverage
4939
run: |

0 commit comments

Comments
 (0)