Skip to content

Commit

Permalink
new way to generate lcov
Browse files Browse the repository at this point in the history
  • Loading branch information
amagyar-iohk committed Mar 12, 2024
1 parent ea342ad commit 047ae8e
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,31 @@ jobs:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
xcodebuild -scheme "AtalaPRISMSDK-Package" \
-destination "platform=iOS Simulator,name=IPhone 14" \
-derivedDataPath "~/.derivedData" \
-enableCodeCoverage YES \
-resultBundlePath TestResults.xcresult \
clean build test | xcpretty
swift build
/Applications/Xcode.app/Contents/Developer/usr/bin/momc \
./AtalaPrismSDK/Pluto/Sources/Resources/PrismPluto.xcdatamodeld \
.build/debug/AtalaPRISMSDK_Pluto.bundle/PrismPluto.momd
swift test --enable-code-coverage
xcrun llvm-cov export \
-format="lcov" \
.build/debug/AtalaPRISMSDKPackageTests.xctest/Contents/MacOS/AtalaPRISMSDKPackageTests \
-instr-profile .build/debug/codecov/default.profdata \
--ignore-filename-regex='.build/.*' \
--ignore-filename-regex='Tests/.*' \
--ignore-filename-regex='Core/.*' > lcov.info

- name: Build coverage report
run: genhtml lcov.info -o coverage_html -q

- name: Generate coverage file
run: |
xcov --scheme "AtalaPRISMSDK-Package"\
--output_directory "build/xcov" \
--derived_data_path "~/.derivedData" \
--is_swift_package true \
--coveralls_repo_token ${{ secrets.GITHUB_TOKEN }} \
--xccov_file_direct_path TestResults.xcresult

- name: Publish tests results
uses: kishikawakatsumi/[email protected]
- name: Publish to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
path: TestResults.xcresult
token: ${{ secrets.GITHUB_TOKEN }}
show-code-coverage: true
if: success() || failure()
file: "lcov.info"

- name: Publish Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: swift-coverage
path: "build/xcov"
path: "coverage_html"

0 comments on commit 047ae8e

Please sign in to comment.