Skip to content

Commit a42ca86

Browse files
authored
Update coverage.yml (#564)
Correct argument to SPM; fix directory creation in workaround. Adjust the exported data location to accommodate the uploading. Enable push event handling.
1 parent 1e9933e commit a42ca86

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/coverage.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: coverage
22

33
on:
4-
# push:
5-
# branches:
6-
# - main
7-
# paths:
8-
# - '**/*.swift'
9-
# - '!Examples/**/*.swift'
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.swift'
9+
- '!Examples/**/*.swift'
1010
workflow_dispatch:
1111

1212
jobs:
@@ -47,20 +47,21 @@ jobs:
4747
New-Item -Path C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\clang\12.0.0\lib\x86_64-unknown-windows-msvc -ItemType Directory
4848
Invoke-WebRequest -Uri "https://artprodeus21.artifacts.visualstudio.com/A8fd008a0-56bc-482c-ba46-67f9425510be/3133d6ab-80a8-4996-ac4f-03df25cd3224/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2NvbXBuZXJkL3Byb2plY3RJZC8zMTMzZDZhYi04MGE4LTQ5OTYtYWM0Zi0wM2RmMjVjZDMyMjQvYnVpbGRJZC81MTM4NS9hcnRpZmFjdE5hbWUvdG9vbGNoYWluLXdpbmRvd3MteDY00/content?format=file&subPath=%2FLibrary%2FDeveloper%2FToolchains%2Funknown-Asserts-development.xctoolchain%2Fusr%2Flib%2Fclang%2F12.0.0%2Flib%2Fx86_64-unknown-windows-msvc%2Fclang_rt.profile.lib" -OutFile C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\clang\12.0.0\lib\x86_64-unknown-windows-msvc\clang_rt.profile.lib
4949
# Workaround for the toolchain issue
50-
New-Item -Path C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\clang\lib\windows
50+
New-Item -Path C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\clang\lib -ItemType Directory
51+
New-Item -Path C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\clang\lib\windows -ItemType Directory
5152
Invoke-WebRequest -Uri "https://artprodeus21.artifacts.visualstudio.com/A8fd008a0-56bc-482c-ba46-67f9425510be/3133d6ab-80a8-4996-ac4f-03df25cd3224/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2NvbXBuZXJkL3Byb2plY3RJZC8zMTMzZDZhYi04MGE4LTQ5OTYtYWM0Zi0wM2RmMjVjZDMyMjQvYnVpbGRJZC81MTM4NS9hcnRpZmFjdE5hbWUvdG9vbGNoYWluLXdpbmRvd3MteDY00/content?format=file&subPath=%2FLibrary%2FDeveloper%2FToolchains%2Funknown-Asserts-development.xctoolchain%2Fusr%2Flib%2Fclang%2F12.0.0%2Flib%2Fx86_64-unknown-windows-msvc%2Fclang_rt.profile.lib" -OutFile C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\clang\lib\windows\clang_rt.profile-x86_64.lib
5253
5354
- name: Build
5455
run: swift build -v
5556

5657
- name: Run tests
57-
run: swift test -v -Xswiftc -DENABLE_TESTING -enable-code-coverage
58+
run: swift test -v -Xswiftc -DENABLE_TESTING --enable-code-coverage
5859

5960
- name: Process Coverage
6061
run: |
61-
llvm-cov export -format lcov -ignore-filename-regex ".build|Tests|Examples" -instr-profile .build\x86_64-unknown-windows-msvc\debug\codecov\default.profdata .build\x86_64-unknown-windows-msvc\debug\SwiftWin32PackageTests.xctest > $env:Temp\coverage.lcov
62+
llvm-cov export -format lcov -ignore-filename-regex ".build|Tests|Examples" -instr-profile .build\x86_64-unknown-windows-msvc\debug\codecov\default.profdata .build\x86_64-unknown-windows-msvc\debug\SwiftWin32PackageTests.xctest > coverage.lcov
6263
6364
- uses: codecov/[email protected]
6465
with:
6566
token: ${{ secrets.CODECOV_TOKEN }}
66-
files: $env:Temp\coverage.lcov
67+
files: coverage.lcov

0 commit comments

Comments
 (0)