Skip to content

Commit b596ed3

Browse files
committed
Upload coverage to GitHub Code Quality
Add the actions/upload-code-coverage step and code-quality:write permission so the coverage percentage surfaces on pull requests. fail-on-error is disabled while the feature is in public preview.
1 parent 916f482 commit b596ed3

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎.github/workflows/swift.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,31 @@ jobs:
2222
coverage:
2323
name: Code Coverage
2424
runs-on: macos-26
25+
permissions:
26+
contents: read
27+
code-quality: write # required by actions/upload-code-coverage
2528
steps:
2629
- name: Checkout
2730
uses: actions/checkout@v4
2831
- name: Swift Version
2932
run: swift --version
3033
- name: Export coverage and enforce threshold
3134
run: Scripts/coverage.sh
32-
- name: Upload coverage report
35+
- name: Upload coverage to GitHub Code Quality
36+
uses: actions/upload-code-coverage@v1
37+
with:
38+
file: .build/coverage/coverage.xml
39+
language: Swift
40+
label: code-coverage/llvm-cov
41+
# Code Quality is in public preview; don't fail CI if the upload/feature
42+
# is unavailable on the repo. Drop this once it's generally available.
43+
fail-on-error: false
44+
- name: Upload coverage artifacts
3345
if: always()
3446
uses: actions/upload-artifact@v4
3547
with:
3648
name: code-coverage
37-
path: .build/coverage/coverage.lcov
49+
path: .build/coverage/
3850
if-no-files-found: error
3951

4052
linux:

0 commit comments

Comments
 (0)