Skip to content
Merged

Fix #185

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
36 changes: 28 additions & 8 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
strategy:
matrix:
platform:
- { name: "iOS", scheme: "iOS Example", destination: "platform=iOS Simulator,name=iPhone 15,OS=latest" }
- { name: "macOS", scheme: "macOS Example", destination: "platform=macOS" }
- { name: "tvOS", scheme: "tvOS Example", destination: "platform=tvOS Simulator,name=Apple TV,OS=latest" }
- { name: "iOS", scheme: "EFQRCode iOS", destination: "platform=iOS Simulator,name=iPhone 15,OS=latest" }
- { name: "macOS", scheme: "EFQRCode macOS", destination: "platform=macOS" }
- { name: "tvOS", scheme: "EFQRCode tvOS", destination: "platform=tvOS Simulator,name=Apple TV,OS=latest" }

steps:
- name: Checkout Repository
Expand All @@ -47,16 +47,36 @@ jobs:

- name: Generate Coverage Report
run: |
xcrun xccov view --report --json ./DerivedData-${{ matrix.platform.name }}/Logs/Test/*.xcresult > coverage-${{ matrix.platform.name }}.json
# Find the xcresult bundle
XCRESULT_PATH=$(find ./DerivedData-${{ matrix.platform.name }}/Logs/Test -name '*.xcresult' | head -1)

if [ -z "$XCRESULT_PATH" ]; then
echo "No .xcresult file found"
ls -la ./DerivedData-${{ matrix.platform.name }}/Logs/Test/
exit 1
fi

echo "Found xcresult at: $XCRESULT_PATH"

# Generate coverage reports in different formats
xcrun xccov view --report --json "$XCRESULT_PATH" > coverage-${{ matrix.platform.name }}.json
xcrun xccov view --report "$XCRESULT_PATH" > coverage-${{ matrix.platform.name }}.txt

# List generated files for debugging
ls -la coverage-*

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage-${{ matrix.platform.name }}.json
flags: unittests,${{ matrix.platform.name }}
files: ./coverage-${{ matrix.platform.name }}.json,./coverage-${{ matrix.platform.name }}.txt
flags: ${{ matrix.platform.name }}
name: codecov-${{ matrix.platform.name }}
fail_ci_if_error: true
fail_ci_if_error: false
verbose: true
override_branch: main
override_commit: ${{ github.sha }}
override_pr: ${{ github.event.number }}

# Status Check
status-check:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<a href="https://swiftpackageindex.com/EFPrefix/EFQRCode">
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FEFPrefix%2FEFQRCode%2Fbadge%3Ftype%3Dplatforms" alt="Compatible with all Platforms">
</a>
<a href="https://codecov.io/gh/EFPrefix/EFQRCode" >
<img src="https://codecov.io/gh/EFPrefix/EFQRCode/graph/badge.svg?token=0nqbfZHB4O"/>
</a>
<a href="https://raw.githubusercontent.com/EFPrefix/EFQRCode/main/LICENSE">
<img src="https://img.shields.io/cocoapods/l/EFQRCode.svg?style=flat">
</a>
Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Tests: XCTestCase {
func testExample3() {
// This is an example of EFQRCodeGenerator test case.
let content = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989"
let generator = try? EFQRCode.Generator(content, style: .bubble(params: .init()))
let testResult = try? generator?.toImage(width: 1200).cgImage()
let generator = try? EFQRCode.Generator(content, style: .dsj(params: .init()))
let testResult = try? generator?.toImage(width: 800).cgImage()
XCTAssertNotNil(testResult, "testResult is nil!")

// This is an example of EFQRCodeRecognizer test case.
Expand Down
5 changes: 4 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ ignore:
- Carthage
- Tests
- Examples
- Package.swift
- Package.swift
- Package@swift-5.3.swift
- Package@swift-5.9.swift
- .github
Loading