Skip to content

Commit cbab34c

Browse files
authored
ci: Fix test coverage with codecov (#1726)
1 parent 12fef3b commit cbab34c

File tree

12 files changed

+45
-42
lines changed

12 files changed

+45
-42
lines changed

.codecov.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,30 @@ jobs:
6868
run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake ${{ matrix.script }}
6969
env:
7070
DEVELOPER_DIR: ${{ (matrix.script == 'package:release' && env.CI_XCODE_11) || env.CI_XCODE_14 }}
71-
- name: Get Artifact Name
71+
- name: Generate Environment Variables
7272
if: ${{ always() }}
7373
env:
7474
ARTIFACT_NAME: ${{ matrix.script }}-logs
75+
TEST_RESULTS: ${{ matrix.script }}.xcresult
7576
run: |
7677
ARTIFACT_NAME=${{ env.ARTIFACT_NAME }}
78+
TEST_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcresult")
7779
echo ARTIFACT_NAME=${ARTIFACT_NAME//:/-} >> $GITHUB_ENV # replace colon with dashes
80+
echo TEST_RESULTS=${TEST_RESULTS} >> $GITHUB_ENV
81+
echo "Artifact Name: $ARTIFACT_NAME"
82+
echo "Test Result Location: $TEST_RESULTS"
7883
- name: Upload Artifact Logs
79-
if: ${{ always() }}
84+
if: ${{ failure() }}
8085
uses: actions/upload-artifact@v3
8186
with:
8287
name: ${{ env.ARTIFACT_NAME }}
8388
path: |
84-
~/Library/Logs/DiagnosticReports
8589
~/Library/Developer/Xcode/DerivedData/Parse-*/Logs/Test
86-
- name: Send Codecov
87-
run: bash <(curl https://codecov.io/bash)
90+
- name: Upload Coverage
91+
uses: codecov/codecov-action@v3.1.1
92+
with:
93+
xcode: true
94+
xcode_archive_path: ${{ env.TEST_RESULTS }}
8895
docs:
8996
runs-on: macos-12
9097
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.DS_Store
33

44
## Build generated
5+
.build/
56
build/
67
DerivedData
78
OCMock.framework

Parse/Parse.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8860,7 +8860,7 @@
88608860
baseConfigurationReference = 81DCD1491D2DA080002501A2 /* Debug.xcconfig */;
88618861
buildSettings = {
88628862
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
8863-
CLANG_ENABLE_CODE_COVERAGE = NO;
8863+
CLANG_ENABLE_CODE_COVERAGE = YES;
88648864
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
88658865
CLANG_WARN_COMMA = YES;
88668866
CLANG_WARN_INFINITE_RECURSION = YES;

ParseFacebookUtils/ParseFacebookUtils.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@
901901
baseConfigurationReference = 8121EAAB1D39862400AC0B02 /* Debug.xcconfig */;
902902
buildSettings = {
903903
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
904-
CLANG_ENABLE_CODE_COVERAGE = NO;
904+
CLANG_ENABLE_CODE_COVERAGE = YES;
905905
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
906906
CLANG_WARN_COMMA = YES;
907907
CLANG_WARN_INFINITE_RECURSION = YES;

ParseFacebookUtils/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES">
3031
<Testables>
3132
<TestableReference
3233
skipped = "NO">

ParseFacebookUtilsTvOs/ParseFacebookUtilsTvOS.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@
672672
baseConfigurationReference = 8121EAAB1D39862400AC0B02 /* Debug.xcconfig */;
673673
buildSettings = {
674674
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
675-
CLANG_ENABLE_CODE_COVERAGE = NO;
675+
CLANG_ENABLE_CODE_COVERAGE = YES;
676676
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
677677
CLANG_WARN_COMMA = YES;
678678
CLANG_WARN_INFINITE_RECURSION = YES;

ParseFacebookUtilsiOS/ParseFacebookUtilsiOS.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@
10781078
baseConfigurationReference = 8121EAAB1D39862400AC0B02 /* Debug.xcconfig */;
10791079
buildSettings = {
10801080
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
1081-
CLANG_ENABLE_CODE_COVERAGE = NO;
1081+
CLANG_ENABLE_CODE_COVERAGE = YES;
10821082
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
10831083
CLANG_WARN_COMMA = YES;
10841084
CLANG_WARN_INFINITE_RECURSION = YES;

ParseTwitterUtils/ParseTwitterUtils.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@
971971
baseConfigurationReference = 8154622F1D37FE6E0069489A /* Debug.xcconfig */;
972972
buildSettings = {
973973
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
974-
CLANG_ENABLE_CODE_COVERAGE = NO;
974+
CLANG_ENABLE_CODE_COVERAGE = YES;
975975
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
976976
CLANG_WARN_COMMA = YES;
977977
CLANG_WARN_INFINITE_RECURSION = YES;

ParseUI/ParseUI.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@
19261926
baseConfigurationReference = 4A9A948E200D02CE005D8F4B /* Debug.xcconfig */;
19271927
buildSettings = {
19281928
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
1929-
CLANG_ENABLE_CODE_COVERAGE = NO;
1929+
CLANG_ENABLE_CODE_COVERAGE = YES;
19301930
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
19311931
CLANG_WARN_BOOL_CONVERSION = YES;
19321932
CLANG_WARN_COMMA = YES;

ParseUI/ParseUI.xcodeproj/xcshareddata/xcschemes/ParseUI.xcscheme

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,25 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES"
31+
onlyGenerateCoverageForSpecifiedTargets = "YES">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "4A9A9496200D0329005D8F4B"
36+
BuildableName = "ParseUI.framework"
37+
BlueprintName = "ParseUI"
38+
ReferencedContainer = "container:ParseUI.xcodeproj">
39+
</BuildableReference>
40+
<BuildableReference
41+
BuildableIdentifier = "primary"
42+
BlueprintIdentifier = "BCCBE8C823BFB89D0044A79C"
43+
BuildableName = "SignInWithAppleTests.xctest"
44+
BlueprintName = "SignInWithAppleTests"
45+
ReferencedContainer = "container:ParseUI.xcodeproj">
46+
</BuildableReference>
47+
</CodeCoverageTargets>
3048
<Testables>
3149
<TestableReference
3250
skipped = "NO">

Rakefile

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,7 @@ namespace :test do
462462
t.scheme = 'Parse-iOS'
463463
t.sdk = 'iphonesimulator'
464464
t.destinations = [ios_simulator]
465-
t.configuration = 'Debug'
466-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
467-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
465+
t.configuration = 'Debug -enableCodeCoverage YES'
468466

469467
t.actions = [XCTask::BuildAction::TEST]
470468
t.formatter = XCTask::BuildFormatter::XCODEBUILD
@@ -483,9 +481,7 @@ namespace :test do
483481

484482
t.scheme = 'Parse-macOS'
485483
t.sdk = 'macosx'
486-
t.configuration = 'Debug'
487-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
488-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
484+
t.configuration = 'Debug -enableCodeCoverage YES'
489485

490486
t.actions = [XCTask::BuildAction::TEST]
491487
t.formatter = XCTask::BuildFormatter::XCODEBUILD
@@ -506,9 +502,7 @@ namespace :test do
506502
t.scheme = 'ParseFacebookUtilsV4-iOS'
507503
t.sdk = 'iphonesimulator'
508504
t.destinations = [ios_simulator]
509-
t.configuration = 'Debug'
510-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
511-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
505+
t.configuration = 'Debug -enableCodeCoverage YES'
512506

513507
t.actions = [XCTask::BuildAction::TEST]
514508
t.formatter = XCTask::BuildFormatter::XCODEBUILD
@@ -532,9 +526,7 @@ namespace :test do
532526
t.scheme = 'ParseTwitterUtils-iOS'
533527
t.sdk = 'iphonesimulator'
534528
t.destinations = [ios_simulator]
535-
t.configuration = 'Debug'
536-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
537-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
529+
t.configuration = 'Debug -enableCodeCoverage YES'
538530

539531
t.actions = [XCTask::BuildAction::TEST]
540532
t.formatter = XCTask::BuildFormatter::XCODEBUILD
@@ -562,7 +554,7 @@ namespace :test do
562554
t.scheme = 'ParseUI'
563555
t.sdk = 'iphonesimulator'
564556
t.destinations = [ios_simulator]
565-
t.configuration = 'Debug'
557+
t.configuration = 'Debug -enableCodeCoverage YES'
566558

567559
t.actions = [XCTask::BuildAction::TEST]
568560
t.formatter = XCTask::BuildFormatter::XCODEBUILD
@@ -584,8 +576,6 @@ namespace :test do
584576
t.sdk = 'iphonesimulator'
585577
t.destinations = [ios_simulator]
586578
t.configuration = 'Debug'
587-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
588-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
589579

590580
t.actions = [XCTask::BuildAction::CLEAN, XCTask::BuildAction::BUILD]
591581
t.formatter = XCTask::BuildFormatter::XCPRETTY
@@ -607,8 +597,6 @@ namespace :test do
607597
t.sdk = 'iphonesimulator'
608598
t.destinations = [ios_simulator]
609599
t.configuration = 'Debug'
610-
t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES",
611-
"GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }
612600

613601
t.actions = [XCTask::BuildAction::CLEAN, XCTask::BuildAction::BUILD]
614602
t.formatter = XCTask::BuildFormatter::XCPRETTY

0 commit comments

Comments
 (0)