Skip to content

Commit 6ef65e3

Browse files
chore: Adds llvm test coverage export
1 parent b58c8fa commit 6ef65e3

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: swift test --parallel --enable-test-discovery
3636

3737
# 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/
38-
ubuntu-old:
38+
ubuntu-20_04:
3939
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
4040
runs-on: ${{ matrix.os }}
4141
strategy:
@@ -50,7 +50,7 @@ jobs:
5050
- name: Test
5151
run: swift test --parallel
5252

53-
ubuntu-latest:
53+
ubuntu-22_04:
5454
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
5555
runs-on: ${{ matrix.os }}
5656
strategy:
@@ -64,3 +64,24 @@ jobs:
6464
- uses: actions/checkout@v3
6565
- name: Test
6666
run: swift test --parallel
67+
68+
ubuntu-latest:
69+
name: Test Latest Swift on Latest Ubuntu
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: swift-actions/setup-swift@v1
73+
- uses: actions/checkout@v3
74+
- name: Test
75+
run: swift test --parallel --enable-code-coverage
76+
- name: Get test coverage html
77+
run: |
78+
llvm-cov show \
79+
$(swift build --show-bin-path)/GraphQLPackageTests.xctest \
80+
--instr-profile $(swift build --show-bin-path)/codecov/default.profdata \
81+
--format html \
82+
--output-dir=.test-coverage
83+
- name: Upload test coverage html
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: test-coverage-report
87+
path: .test-coverage

.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)