Skip to content

Commit

Permalink
chore: Reporting Code Coverage to Codecov.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas committed Jan 22, 2024
1 parent 1f9514e commit 96b101a
Show file tree
Hide file tree
Showing 5 changed files with 1,775 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run Unit Tests

on:
push:
branches: [ main ]
branches: [ main, feat/coverage ]
pull_request:
branches: [ main ]

Expand All @@ -14,7 +14,16 @@ 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: Upload 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
Scripts/codecov.sh -F 'Authenticator'
unit-test-macos:

Expand Down
3 changes: 2 additions & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/Authenticator.xcscheme
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
Loading

0 comments on commit 96b101a

Please sign in to comment.