Skip to content

Commit 79c0ef9

Browse files
authored
Codecov (#7)
1 parent 6614d28 commit 79c0ef9

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
name: Pull request
2-
on: pull_request
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review]
6+
push:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
313

414
env:
515
XCODE_VERSION: "16.3"
@@ -92,6 +102,7 @@ jobs:
92102
- name: Build (SPM)
93103
if: ${{ matrix.platform == 'macos' }}
94104
run: swift build
105+
95106
- name: Build (Xcode)
96107
if: ${{ matrix.platform != 'macos' }}
97108
run: |
@@ -105,7 +116,13 @@ jobs:
105116
if: ${{ matrix.platform == 'macos' }}
106117
run: |
107118
set -o pipefail
108-
swift test | xcbeautify --renderer github-actions
119+
swift test --enable-code-coverage | xcbeautify --renderer github-actions
120+
TEST_BUNDLE=$(find .build/debug/ -name "*.xctest" | head -n 1)
121+
TEST_EXECUTABLE="$TEST_BUNDLE/Contents/MacOS/$(basename "$TEST_BUNDLE" .xctest)"
122+
xcrun llvm-cov export -format="lcov" \
123+
-instr-profile .build/debug/codecov/default.profdata \
124+
"$TEST_EXECUTABLE" > info.lcov
125+
109126
- name: Test (Xcode)
110127
if: ${{ matrix.platform != 'macos' }}
111128
run: |
@@ -114,3 +131,9 @@ jobs:
114131
-scheme ${{ needs.prepare.outputs.scheme }} \
115132
-destination "${{ steps.destination.outputs.destination }}" | \
116133
xcbeautify --renderer github-actions
134+
135+
- name: Check coverage (SPM)
136+
if: ${{ matrix.platform == 'macos' }}
137+
uses: codecov/codecov-action@v5
138+
with:
139+
fail_ci_if_error: true

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release
2+
23
on:
34
push:
45
tags:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# PrincipleMacros
22

33
![Swift](https://img.shields.io/badge/Swift-6.0-EF5239?logo=swift&labelColor=white)
4+
[![Codecov](https://codecov.io/gh/NSFatalError/PrincipleMacros/graph/badge.svg?token=3883VA6VPI)](https://codecov.io/gh/NSFatalError/PrincipleMacros)
45

56
Essential tools that extend the capabilities of `SwiftSyntax`, simplifying the implementation of custom macros.
67

0 commit comments

Comments
 (0)