From 028067c2e10ee262b1e1af0f898b2e72e5230d47 Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:15:28 +0200 Subject: [PATCH 1/7] actions: Add code coverage --- .github/workflows/ios.yml | 8 +++++++- README.md | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index c35fc2e..63c2d32 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -41,4 +41,10 @@ jobs: xcodebuild \ -scheme "$TEST_SCHEME" \ -destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ - test \ No newline at end of file + -enableCodeCoverage YES \ + test + - name: Lcov file generation + run: | + xcrun llvm-cov export -format="lcov" -instr-profile "DerivedData/Build/Intermediates.noindex/CryptoWidgetKitApp.build/Debug-iphonesimulator/CryptoWidgetKitApp.build/Objects-normal/x86_64/CryptoWidgetKitAppTests.gcda" -output-file "lcov.info" + - name: Coveralls + uses: coverallsapp/github-action@v2 \ No newline at end of file diff --git a/README.md b/README.md index 0e00ff8..9ba3091 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ # CryptoWidgetKitApp + +[![CodeFactor](https://www.codefactor.io/repository/github/josetorronteras/cryptowidgetkitapp/badge)](https://www.codefactor.io/repository/github/josetorronteras/cryptowidgetkitapp) + +[![iOS build and test workflow](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml/badge.svg?branch=main)](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml) \ No newline at end of file From e8b94cabeb9cf70369b3207e87928c0cfebe57fb Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:35:10 +0200 Subject: [PATCH 2/7] Update ios.yml --- .github/workflows/ios.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 63c2d32..9d7bfa7 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -20,8 +20,8 @@ jobs: fail-fast: true matrix: # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators - xcode_version: [ "15.0.1", "15.4" ] - os_version: [ "17.0.1", "17.5" ] + xcode_version: [ "15.4" ] + os_version: [ "17.0.1"] steps: - name: Checkout uses: actions/checkout@v3 @@ -45,6 +45,6 @@ jobs: test - name: Lcov file generation run: | - xcrun llvm-cov export -format="lcov" -instr-profile "DerivedData/Build/Intermediates.noindex/CryptoWidgetKitApp.build/Debug-iphonesimulator/CryptoWidgetKitApp.build/Objects-normal/x86_64/CryptoWidgetKitAppTests.gcda" -output-file "lcov.info" + xcrun llvm-cov export -format="lcov" .build/debug/EmailValidationPackageTests.xctest/Contents/MacOS/EmailValidationPackageTests -instr-profile .build/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" > info.lcov - name: Coveralls uses: coverallsapp/github-action@v2 \ No newline at end of file From a8ea5960eeeef15142fc3093e9eb4401488d16c5 Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:42:16 +0200 Subject: [PATCH 3/7] Add xctestplan --- CryptoWidgetKitApp.xcodeproj/project.pbxproj | 2 + .../xcschemes/CryptoWidgetKitApp.xcscheme | 95 +++++++++++++++++++ .../CryptoWidgetKitApp.xctestplan | 28 ++++++ 3 files changed, 125 insertions(+) create mode 100644 CryptoWidgetKitApp.xcodeproj/xcshareddata/xcschemes/CryptoWidgetKitApp.xcscheme create mode 100644 CryptoWidgetKitAppTests/CryptoWidgetKitApp.xctestplan diff --git a/CryptoWidgetKitApp.xcodeproj/project.pbxproj b/CryptoWidgetKitApp.xcodeproj/project.pbxproj index a273ccb..1e1ece2 100644 --- a/CryptoWidgetKitApp.xcodeproj/project.pbxproj +++ b/CryptoWidgetKitApp.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ 4D8251C52C05EAD700DD32A3 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; 4D8251C72C05EBBB00DD32A3 /* MockURLSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockURLSession.swift; sourceTree = ""; }; 4D8251C92C05EC4500DD32A3 /* URLSessionProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionProtocol.swift; sourceTree = ""; }; + 4D8251E42C0F7B0300DD32A3 /* CryptoWidgetKitApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoWidgetKitApp.xctestplan; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -113,6 +114,7 @@ 4D7266592C049D820035E348 /* CryptoWidgetKitAppTests */ = { isa = PBXGroup; children = ( + 4D8251E42C0F7B0300DD32A3 /* CryptoWidgetKitApp.xctestplan */, 4D8251C02C05E9F100DD32A3 /* Mocks */, 4D8251C12C05E9FE00DD32A3 /* Network */, 4D72665A2C049D820035E348 /* CryptoWidgetKitAppTests.swift */, diff --git a/CryptoWidgetKitApp.xcodeproj/xcshareddata/xcschemes/CryptoWidgetKitApp.xcscheme b/CryptoWidgetKitApp.xcodeproj/xcshareddata/xcschemes/CryptoWidgetKitApp.xcscheme new file mode 100644 index 0000000..1e059c0 --- /dev/null +++ b/CryptoWidgetKitApp.xcodeproj/xcshareddata/xcschemes/CryptoWidgetKitApp.xcscheme @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CryptoWidgetKitAppTests/CryptoWidgetKitApp.xctestplan b/CryptoWidgetKitAppTests/CryptoWidgetKitApp.xctestplan new file mode 100644 index 0000000..d3b52a9 --- /dev/null +++ b/CryptoWidgetKitAppTests/CryptoWidgetKitApp.xctestplan @@ -0,0 +1,28 @@ +{ + "configurations" : [ + { + "id" : "9F0B5D53-33C8-4636-BB91-BF892799921C", + "name" : "Test Scheme Action", + "options" : { + + } + } + ], + "defaultOptions" : { + "targetForVariableExpansion" : { + "containerPath" : "container:CryptoWidgetKitApp.xcodeproj", + "identifier" : "4D7266452C049D800035E348", + "name" : "CryptoWidgetKitApp" + } + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:CryptoWidgetKitApp.xcodeproj", + "identifier" : "4D7266552C049D820035E348", + "name" : "CryptoWidgetKitAppTests" + } + } + ], + "version" : 1 +} From 7bc9c531514eaac4c2d593ad23b1bd6da043489b Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:02:07 +0200 Subject: [PATCH 4/7] Use codecov --- .github/workflows/ios.yml | 11 +++++------ README.md | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 9d7bfa7..4e373e4 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -41,10 +41,9 @@ jobs: xcodebuild \ -scheme "$TEST_SCHEME" \ -destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ - -enableCodeCoverage YES \ + -enableCodeCoverage YES \ test - - name: Lcov file generation - run: | - xcrun llvm-cov export -format="lcov" .build/debug/EmailValidationPackageTests.xctest/Contents/MacOS/EmailValidationPackageTests -instr-profile .build/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" > info.lcov - - name: Coveralls - uses: coverallsapp/github-action@v2 \ No newline at end of file + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 9ba3091..19ac449 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ [![CodeFactor](https://www.codefactor.io/repository/github/josetorronteras/cryptowidgetkitapp/badge)](https://www.codefactor.io/repository/github/josetorronteras/cryptowidgetkitapp) -[![iOS build and test workflow](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml/badge.svg?branch=main)](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml) \ No newline at end of file +[![iOS build and test workflow](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml/badge.svg?branch=main)](https://github.com/josetorronteras/CryptoWidgetKitApp/actions/workflows/ios.yml) + +[![codecov](https://codecov.io/gh/josetorronteras/CryptoWidgetKitApp/graph/badge.svg?token=5O0SZMNM97)](https://codecov.io/gh/josetorronteras/CryptoWidgetKitApp) \ No newline at end of file From 524fd3c6fa8156354779e121c4d4e99791dd962c Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:03:57 +0200 Subject: [PATCH 5/7] Update ios.yml --- .github/workflows/ios.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 4e373e4..5a2cf72 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -44,6 +44,6 @@ jobs: -enableCodeCoverage YES \ test - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From c46487db93b370eb1c64d00d32ba4c20b75f3dc3 Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:05:40 +0200 Subject: [PATCH 6/7] Update ios.yml --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5a2cf72..131c233 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -41,7 +41,7 @@ jobs: xcodebuild \ -scheme "$TEST_SCHEME" \ -destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ - -enableCodeCoverage YES \ + -enableCodeCoverage YES \ test - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 From fcaecca4fdcb1d4b0f1b7e57fe21b48b5854ad55 Mon Sep 17 00:00:00 2001 From: Jose Torronteras <7280807+josetorronteras@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:07:26 +0200 Subject: [PATCH 7/7] Update ios.yml --- .github/workflows/ios.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 131c233..512e2ca 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -8,7 +8,6 @@ on: env: SCHEME: CryptoWidgetKitApp - TEST_SCHEME: CryptoWidgetKitAppTests SIMULATOR: "iPhone 15" jobs: @@ -39,7 +38,7 @@ jobs: - name: Test run: | xcodebuild \ - -scheme "$TEST_SCHEME" \ + -scheme "$SCHEME" \ -destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ -enableCodeCoverage YES \ test