Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Reporting Code Coverage to Codecov. #53

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ jobs:
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Unit test Authenticator on iOS
run: xcodebuild test -scheme Authenticator -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
run: xcodebuild test -scheme Authenticator -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' -derivedDataPath Build/ -enableCodeCoverage YES -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Authenticator | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
- name: Generate Coverage Report
continue-on-error: true
run: |
cd Build/Build/ProfileData
cd $(ls -d */|head -n 1)
pathCoverage=Build/Build/ProfileData/${PWD##*/}/Coverage.profdata
cd ${{ github.workspace }}
xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug-iphonesimulator/Authenticator.o > Authenticator-Coverage.lcov
- name: Upload Report
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
flags: Authenticator
verbose: true

unit-test-macos:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Amplify UI Authenticator for SwiftUI

[![GitHub](https://img.shields.io/github/license/aws-amplify/amplify-ui-swift-liveness)](LICENSE)
[![GitHub](https://img.shields.io/github/license/aws-amplify/amplify-ui-swift-authenticator)](LICENSE)
[![Code Coverage](https://codecov.io/gh/aws-amplify/amplify-ui-swift-authenticator/branch/main/graph/badge.svg)](https://codecov.io/gh/aws-amplify/amplify-ui-swift-authenticator)
[![Discord](https://img.shields.io/discord/308323056592486420?logo=discord)](https://discord.gg/jWVbPfC)
[![Open Bugs](https://img.shields.io/github/issues/aws-amplify/amplify-ui-swift-authenticator/bug?color=d73a4a&label=bugs)](https://github.com/aws-amplify/amplify-ui-swift-authenticator/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
[![Feature Requests](https://img.shields.io/github/issues/aws-amplify/amplify-ui-swift-authenticator/feature-request?color=ff9001&label=feature%20requests)](https://github.com/aws-amplify/amplify-ui-swift-authenticator/issues?q=is%3Aissue+label%3Afeature-request+is%3Aopen)
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ignore:
- "**/Views"
- "**/Authenticator.swift"

codecov:
branch: main

coverage:
status:
project:
default:
threshold: 1%
Loading