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
sebaland committed Jan 25, 2024
1 parent feaaa47 commit 3145f1a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- feat/coverage
pull_request:
branches:
- main
Expand Down Expand Up @@ -34,6 +35,21 @@ jobs:
- name: Run unit tests
run: bundle exec fastlane ios tests

- 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/AmplifyUtilsNotifications.o > AmplifyUtilsNotifications-Coverage.lcov
- name: Upload Report
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
continue-on-error: true
with:
flags: AmplifyUtilsNotifications

- name: Run integration tests
run: bundle exec fastlane ios integration_tests

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Amplify Swift Utilities for Notifications

[![Code Coverage](https://codecov.io/gh/aws-amplify/amplify-swift-utils-notifications/branch/main/graph/badge.svg)](https://codecov.io/gh/aws-amplify/amplify-swift-utils-notifications)

Amplify Swift Utilities for Notifications provides helpful functionality for working with push notifications on iOS and macOS.

Although it was developed for use with AWS Amplify, it can also be used independently.
Expand Down
3 changes: 3 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ platform :ios do
package_path: ".",
sdk: "iphonesimulator",
device: "iPhone 14",
derived_data_path: "Build/",
code_coverage: true,
cloned_source_packages_path: "~/Library/Developer/Xcode/DerivedData/AmplifyUtilsNotifications"
)
end

Expand Down

0 comments on commit 3145f1a

Please sign in to comment.