Skip to content

Commit f3526a2

Browse files
committed
chore: use xcodebuild to test and calculate code coverage
1 parent c44f8d5 commit f3526a2

5 files changed

Lines changed: 33 additions & 6 deletions

File tree

.github/workflows/beta-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
tags:
55
- "v*.*.*-beta"
66
jobs:
7-
test:
7+
beta-release:
88
runs-on: macos-latest
99
steps:
1010
- name: Checkout

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
tags:
55
- "v[0-9]+.[0-9]+.[0-9]+"
66
jobs:
7-
test:
7+
release:
88
runs-on: macos-latest
99
steps:
1010
- name: Checkout

.github/workflows/test.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,39 @@ name: Run tests
22
on: [push]
33
jobs:
44
test:
5-
runs-on: macos-latest
5+
runs-on: macos-11
66
steps:
77
- name: Checkout
88
uses: actions/checkout@v2
99
- name: Resolve Dependency
1010
run: swift package update
11+
# - name: Generate XCode project
12+
# run: swift package generate-xcodeproj
1113
- name: Test
12-
run: swift test --enable-code-coverage
13-
- name: Covert Code Coverage
14-
run: xcrun llvm-cov export -format=lcov .build/debug/TypedNotificationPackageTests.xctest/Contents/MacOS/TypedNotificationPackageTests -instr-profile=.build/debug/codecov/default.profdata > lcov.info
14+
uses: sersoft-gmbh/xcodebuild-action@v1
15+
with:
16+
# project: TypedNotification.xcodeproj
17+
spm-package: .
18+
# scheme: TypedNotification-Package
19+
scheme: TypedNotification
20+
derived-data-path: ./output
21+
destination: "OS=15.0,name=iPhone 13 Mini"
22+
action: test
23+
enable-code-coverage: true
24+
build-settings: ENABLE_TESTING_SEARCH_PATHS=YES
25+
- name: Generate Coverage Report
26+
uses: maxep/xcodebuild-lcov-action@0.1.0
27+
with:
28+
derived-data-path: ./output
29+
target: TypedNotificationTests
30+
output-file: ./output/coverage.lcov
31+
- name: Archive Artifacts
32+
uses: actions/upload-artifact@v2
33+
if: failure()
34+
with:
35+
path: ./output
1536
- name: Upload Codecov
1637
uses: codecov/codecov-action@v2
38+
with:
39+
directory: ./output
40+
verbose: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ Packages/
3939
Package.pins
4040
Package.resolved
4141
.build/
42+
.output/
4243
.swiftpm
4344
/build
45+
TypedNotification.xcodeproj
4446

4547
# CocoaPods
4648
#

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Swift Package Manager](https://img.shields.io/badge/SwiftPM-Compatiable-brightgreen.svg)](https://swift.org/package-manager/)
44
[![release](https://img.shields.io/github/release/dbi1463/typed-notification/all.svg)](https://github.com/dbi1463/typed-notification/releases)
55
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
6+
[![codecov](https://codecov.io/gh/dbi1463/typed-notification/branch/develop/graph/badge.svg?token=5hEk4BfOif)](https://codecov.io/gh/dbi1463/typed-notification)
67

78
A type-safe way to receive notifications.
89

0 commit comments

Comments
 (0)