Skip to content

Commit 32621b0

Browse files
committed
Add code coverage job to CI
1 parent 230846c commit 32621b0

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,36 @@ jobs:
1818
- name: Test
1919
run: swift test -v
2020

21+
coverage:
22+
name: Code Coverage
23+
runs-on: macos-26
24+
permissions:
25+
contents: read
26+
code-quality: write # required by actions/upload-code-coverage
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Export coverage and enforce threshold
30+
run: Scripts/coverage.sh
31+
env:
32+
COVERAGE_THRESHOLD: 65
33+
- name: Upload coverage to GitHub Code Quality
34+
uses: actions/upload-code-coverage@v1
35+
with:
36+
file: .build/coverage/coverage.xml
37+
language: Swift
38+
label: code-coverage/llvm-cov
39+
# Code Quality was in public preview until 2026-07-20; keep this while
40+
# the repo might not have the feature enabled, so a failed upload
41+
# doesn't break CI.
42+
fail-on-error: false
43+
- name: Upload coverage artifacts
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: code-coverage
48+
path: .build/coverage/
49+
if-no-files-found: error
50+
2151
linux:
2252
runs-on: ubuntu-latest
2353
container: swift:6.3.3

0 commit comments

Comments
 (0)