Skip to content

Commit 62ead02

Browse files
chore: Adds llvm test coverage export
1 parent c48ab0e commit 62ead02

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,27 @@ jobs:
2323
- name: Run format linting
2424
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint
2525

26-
# Disabled until https://github.com/paulofaria/test-reporter is updated to Swift 5.4
2726
macos:
2827
name: Build and test on macOS
2928
runs-on: macOS-latest
3029
steps:
31-
- uses: actions/checkout@v2
32-
- name: Set code coverage path
33-
run: echo "codecov_path=$(swift test --show-codecov-path)" >> $GITHUB_ENV
34-
- name: Test and publish code coverage to Code Climate
35-
uses: paulofaria/codeclimate-action@master
36-
env:
37-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
30+
- uses: maxim-lobanov/setup-xcode@v1
3831
with:
39-
downloadUrl: https://github.com/paulofaria/test-reporter/releases/download/0.9.0/test-reporter-0.9.0-darwin-amd64
40-
coverageCommand: swift test --parallel --enable-test-discovery --enable-code-coverage
41-
coverageLocations: ${{ env.codecov_path }}:lcov-json
32+
xcode-version: latest
33+
- uses: actions/checkout@v3
34+
- name: Build and test
35+
run: swift test --parallel --enable-test-discovery --enable-code-coverage
36+
- name: Get test coverage html
37+
run: llvm-cov show \
38+
.build/x86_64-apple-macosx/debug/GraphitiPackageTests.xctest/Contents/MacOS/GraphitiPackageTests \
39+
--instr-profile .build/x86_64-apple-macosx/debug/codecov/default.profdata \
40+
--format html \
41+
--output-dir=.test-coverage
42+
- name: Upload test coverage html
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: test-coverage-report
46+
path: .test-coverage
4247

4348
# ubuntu-latest is ubuntu-22.04 currently. Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
4449
ubuntu-old:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
### SwiftPM ###
44
/.build
55
/.swiftpm
6+
7+
### CI Artifacts ###
8+
/.test-coverage

0 commit comments

Comments
 (0)