From 12d48810ba48bf0b8239399c0737f1b157231000 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 13:18:34 -0800 Subject: [PATCH 01/18] remove ruby steps --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b74cdc8..f6b5fe6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Install Bundler - run: gem install bundler - - - name: Install dependencies - run: bundle install - - name: Build and Test run: | swift build From 9151e284b80a1a8fb3d44f0a982c6701baf4cbb6 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 13:19:40 -0800 Subject: [PATCH 02/18] run on prs --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6b5fe6..8f3364f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,7 @@ name: test.yml on: - push: - branches: - - integrate_codecov - workflow_dispatch: + pull_request: jobs: build: From 4bcfd1c6632411b58bae07d5e6121e073c4ad65c Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 13:23:48 -0800 Subject: [PATCH 03/18] fix test job command and coverage report location --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f3364f..0166ecc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,8 @@ jobs: uses: actions/checkout@v3 - name: Build and Test - run: | - swift build - swift test + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 14" -quiet test - name: Generate Coverage Report run: | - xcrun xccov view --report /Logs/Test/*.xccovreport > coverage.txt + xcrun xccov view --report build/Logs/Test/*.xccovreport > coverage.txt From 73be85583742c658683341312b96a8c89240cbdb Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 13:29:15 -0800 Subject: [PATCH 04/18] fix iphone os deployment versions and update to 15 --- .github/workflows/test.yml | 2 +- EmpowerPlant.xcodeproj/project.pbxproj | 4 ---- deploy_project.sh | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0166ecc..02490bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v3 - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 14" -quiet test + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test - name: Generate Coverage Report run: | diff --git a/EmpowerPlant.xcodeproj/project.pbxproj b/EmpowerPlant.xcodeproj/project.pbxproj index 1b96a20..3091565 100644 --- a/EmpowerPlant.xcodeproj/project.pbxproj +++ b/EmpowerPlant.xcodeproj/project.pbxproj @@ -332,7 +332,6 @@ CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = sentrydemos.ios.EmpowerPlantTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -351,7 +350,6 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = sentrydemos.ios.EmpowerPlantTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -414,7 +412,6 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -470,7 +467,6 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.4; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; diff --git a/deploy_project.sh b/deploy_project.sh index 42c5176..f67a989 100755 --- a/deploy_project.sh +++ b/deploy_project.sh @@ -15,7 +15,7 @@ SENTRY_AUTH_TOKEN_INPUT=${4} # Build the release bundle echo "Building the release bundle..." -SENTRY_ORG=$SENTRY_ORG_INPUT SENTRY_PROJECT=$SENTRY_PROJECT_INPUT SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN_INPUT xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 14" -quiet clean build +SENTRY_ORG=$SENTRY_ORG_INPUT SENTRY_PROJECT=$SENTRY_PROJECT_INPUT SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN_INPUT xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet clean build zip -r EmpowerPlant_release.zip ./build/Build/Products/Release-iphonesimulator/EmpowerPlant.app ZIP_PATH="./EmpowerPlant_release.zip" From 8fd4466c4d7520d632d926bbd699e482be13d6d5 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 13:54:57 -0800 Subject: [PATCH 05/18] use macos-14 image --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02490bf..8ec7e53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: macos-14 steps: - name: Checkout code From 732c68dd5d9c7ce0fc3987065337818f2177e9be Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 14:48:49 -0800 Subject: [PATCH 06/18] only upload debug symbols for release builds --- .github/workflows/test.yml | 2 +- upload-symbols.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ec7e53..5ac9fd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v3 - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Release -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test - name: Generate Coverage Report run: | diff --git a/upload-symbols.sh b/upload-symbols.sh index 7db2fe4..0634140 100755 --- a/upload-symbols.sh +++ b/upload-symbols.sh @@ -2,6 +2,11 @@ export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin" +if [ $CONFIGURATION != 'Release' ]; then + echo "Will not upload debug symbols for non-release build." + exit 0 +fi + if which sentry-cli >/dev/null; then # get SENTRY_ORG and SENTRY_PROJECT values From 13288104eb198f7bc4336c2c2daae8f95fc32bed Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Apr 2024 15:11:39 -0800 Subject: [PATCH 07/18] generate code coverage --- EmpowerPlant.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EmpowerPlant.xcodeproj/project.pbxproj b/EmpowerPlant.xcodeproj/project.pbxproj index 3091565..4b78ac2 100644 --- a/EmpowerPlant.xcodeproj/project.pbxproj +++ b/EmpowerPlant.xcodeproj/project.pbxproj @@ -400,6 +400,7 @@ ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -460,6 +461,7 @@ ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; From 96a04f9fc73a91a3739be4d650ae94e536676443 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 10:07:44 -0800 Subject: [PATCH 08/18] use slather to generate coverage report and upload to codecov in same workflow --- .github/workflows/test.yml | 12 +++++++----- .github/workflows/upload-codecov-report.yml | 8 -------- 2 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 .github/workflows/upload-codecov-report.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ac9fd8..7b3fe1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,9 +11,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test + - name: Install Slather + run: gem install slather - - name: Generate Coverage Report - run: | - xcrun xccov view --report build/Logs/Test/*.xccovreport > coverage.txt + - name: Build and Test + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 diff --git a/.github/workflows/upload-codecov-report.yml b/.github/workflows/upload-codecov-report.yml deleted file mode 100644 index c9b9edb..0000000 --- a/.github/workflows/upload-codecov-report.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: upload-codecov-report.yml -on: [push] -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 From 2bba1cf5cba9c8d2e57be9ace163869382e628f8 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 11:52:59 -0800 Subject: [PATCH 09/18] add .slather.yml --- .slather.yml | 7 +++++++ EmpowerPlant.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 .slather.yml diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 0000000..29f357b --- /dev/null +++ b/.slather.yml @@ -0,0 +1,7 @@ +coverage_service: cobertura_xml +xcodeproj: EmpowerPlant.xcodeproj +workspace: EmpowerPlant.xcworkspace +scheme: EmpowerPlant +source_directory: EmpowerPlant +output_directory: slather + diff --git a/EmpowerPlant.xcodeproj/project.pbxproj b/EmpowerPlant.xcodeproj/project.pbxproj index 4b78ac2..f63f9fb 100644 --- a/EmpowerPlant.xcodeproj/project.pbxproj +++ b/EmpowerPlant.xcodeproj/project.pbxproj @@ -39,6 +39,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 840B7EF12BBF3C70008B8120 /* .slather.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .slather.yml; sourceTree = ""; }; 843BD60E2AD08CE900B0098F /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; 843BD6262AD7798C00B0098F /* jwt-deep-field.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jwt-deep-field.png"; sourceTree = ""; }; 846BEA1A2ABE46880032F77F /* upload-symbols.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "upload-symbols.sh"; sourceTree = ""; }; @@ -103,6 +104,7 @@ 8474F0482ACCE2D800F21E06 /* deploy_project.sh */, 84A2641E2AA926A300A62A88 /* .env */, 846BEA1A2ABE46880032F77F /* upload-symbols.sh */, + 840B7EF12BBF3C70008B8120 /* .slather.yml */, 84A264192AA915B100A62A88 /* Brewfile */, 84A264182AA9155800A62A88 /* Makefile */, 84A2641B2AA915D800A62A88 /* README.md */, From 26d7566bb093433ec6b6d34c4dbec15f6605bd9e Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 11:58:18 -0800 Subject: [PATCH 10/18] dont override DDD --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b3fe1b..badaf62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: run: gem install slather - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 From 2538c71b3625ebf7d1ae7e74af933d13dd9c6e15 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 12:06:09 -0800 Subject: [PATCH 11/18] use DDD override and specify in slather config --- .github/workflows/test.yml | 2 +- .slather.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index badaf62..7b3fe1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: run: gem install slather - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} + run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/.slather.yml b/.slather.yml index 29f357b..813bdd6 100644 --- a/.slather.yml +++ b/.slather.yml @@ -4,4 +4,4 @@ workspace: EmpowerPlant.xcworkspace scheme: EmpowerPlant source_directory: EmpowerPlant output_directory: slather - +build_directory: build From 944a4ec8ecc1035d4a4dc610d6525a2541c80b5c Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 12:06:28 -0800 Subject: [PATCH 12/18] also remove xcworkspace directive --- .slather.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.slather.yml b/.slather.yml index 813bdd6..9999fea 100644 --- a/.slather.yml +++ b/.slather.yml @@ -1,6 +1,5 @@ coverage_service: cobertura_xml xcodeproj: EmpowerPlant.xcodeproj -workspace: EmpowerPlant.xcworkspace scheme: EmpowerPlant source_directory: EmpowerPlant output_directory: slather From 8e9deb1650e0f251ed6822bb0dbe567ef6ee123b Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 12:55:04 -0800 Subject: [PATCH 13/18] move to makefile, fix build/test/slather sequence --- .github/workflows/test.yml | 2 +- .gitignore | 3 ++- Makefile | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b3fe1b..f90386b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: run: gem install slather - name: Build and Test - run: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test | slather coverage --configuration Debug && exit ${PIPESTATUS[0]} + run: make test - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/.gitignore b/.gitignore index a53a8ed..611f2ac 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .env build/ release-build.log -EmpowerPlant_release.zip \ No newline at end of file +EmpowerPlant_release.zip +slather/ \ No newline at end of file diff --git a/Makefile b/Makefile index 50e8029..b62db73 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,8 @@ init: # download iOS platform image # (happens on fresh xcode installation or MAS-managed major version update) xcodebuild -downloadPlatform iOS + +.PHONY: test +test: + xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet build-for-testing + xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test-without-building | rbenv exec slather coverage --verbose && exit ${PIPESTATUS[0]} From ef2f1fc22fa7980a588573be068cb2a4a4a9bf61 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 12:57:14 -0800 Subject: [PATCH 14/18] no rbenv --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b62db73..3189014 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,4 @@ init: .PHONY: test test: xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet build-for-testing - xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test-without-building | rbenv exec slather coverage --verbose && exit ${PIPESTATUS[0]} + xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test-without-building | slather coverage --verbose && exit ${PIPESTATUS[0]} From d6a545885882e71c1c0257035c0be852bef4c7d1 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 16:42:08 -0800 Subject: [PATCH 15/18] just slather after the test command, not in pipeline --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3189014..3a7bd9e 100644 --- a/Makefile +++ b/Makefile @@ -20,5 +20,5 @@ init: .PHONY: test test: - xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet build-for-testing - xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test-without-building | slather coverage --verbose && exit ${PIPESTATUS[0]} + xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test + slather coverage --verbose From ed26e3abfc06599dba699b73017a976a921b5bcf Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 22:39:31 -0700 Subject: [PATCH 16/18] undo upload-symbols.sh chabnge --- upload-symbols.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/upload-symbols.sh b/upload-symbols.sh index 0634140..7db2fe4 100755 --- a/upload-symbols.sh +++ b/upload-symbols.sh @@ -2,11 +2,6 @@ export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin" -if [ $CONFIGURATION != 'Release' ]; then - echo "Will not upload debug symbols for non-release build." - exit 0 -fi - if which sentry-cli >/dev/null; then # get SENTRY_ORG and SENTRY_PROJECT values From 0fd2ccb3c3cdac2b56318bd3c3c15ef70f68ca29 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 22:44:10 -0700 Subject: [PATCH 17/18] use a new build config to avoid uploading debug symbols from test.yml runs --- EmpowerPlant.xcodeproj/project.pbxproj | 104 +++++++++++++++++++++++++ Makefile | 4 +- upload-symbols.sh | 5 ++ 3 files changed, 111 insertions(+), 2 deletions(-) diff --git a/EmpowerPlant.xcodeproj/project.pbxproj b/EmpowerPlant.xcodeproj/project.pbxproj index f63f9fb..be5a210 100644 --- a/EmpowerPlant.xcodeproj/project.pbxproj +++ b/EmpowerPlant.xcodeproj/project.pbxproj @@ -325,6 +325,107 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 848A45232BBFC6FE006AAAEC /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 97JCY7859U; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = "-D DEBUG"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Test; + }; + 848A45242BBFC6FE006AAAEC /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 97JCY7859U; + INFOPLIST_FILE = EmpowerPlant/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = sentrydemos.ios.EmpowerPlant; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Test; + }; + 848A45252BBFC6FE006AAAEC /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = sentrydemos.ios.EmpowerPlantTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EmpowerPlant.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/EmpowerPlant"; + }; + name = Test; + }; 8BA3AB322A201FE900BE1EA8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -527,6 +628,7 @@ isa = XCConfigurationList; buildConfigurations = ( 8BA3AB322A201FE900BE1EA8 /* Debug */, + 848A45252BBFC6FE006AAAEC /* Test */, 8BA3AB332A201FE900BE1EA8 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -536,6 +638,7 @@ isa = XCConfigurationList; buildConfigurations = ( D17C73C127D8291D006650AF /* Debug */, + 848A45232BBFC6FE006AAAEC /* Test */, D17C73C227D8291D006650AF /* Release */, ); defaultConfigurationIsVisible = 0; @@ -545,6 +648,7 @@ isa = XCConfigurationList; buildConfigurations = ( D17C73C427D8291D006650AF /* Debug */, + 848A45242BBFC6FE006AAAEC /* Test */, D17C73C527D8291D006650AF /* Release */, ); defaultConfigurationIsVisible = 0; diff --git a/Makefile b/Makefile index 3a7bd9e..dd3e0e6 100644 --- a/Makefile +++ b/Makefile @@ -20,5 +20,5 @@ init: .PHONY: test test: - xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Debug -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test - slather coverage --verbose + xcodebuild -project EmpowerPlant.xcodeproj -scheme EmpowerPlant -configuration Test -derivedDataPath build -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" -quiet test + slather coverage --configuration Test --verbose diff --git a/upload-symbols.sh b/upload-symbols.sh index 7db2fe4..3cacf4a 100755 --- a/upload-symbols.sh +++ b/upload-symbols.sh @@ -2,6 +2,11 @@ export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin" +if [ $CONFIGURATION == 'Test' ]; then + echo "Will not upload debug symbols for test build." + exit 0 +fi + if which sentry-cli >/dev/null; then # get SENTRY_ORG and SENTRY_PROJECT values From 2588b07f3f515ff0f748633b83c3a8d37afdba14 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Thu, 4 Apr 2024 22:46:54 -0700 Subject: [PATCH 18/18] add .codecov.yml --- .codecov.yml | 25 +++++++++++++++++++++++++ EmpowerPlant.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..76b6841 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,25 @@ +codecov: + branch: main + require_ci_to_pass: yes + notify: + wait_for_ci: yes + +coverage: + range: 80...100 + precision: 3 + round: down + +ignore: + - "EmpowerPlantTests/*" + +comment: + layout: "reach,diff,flags,files,footer" + # Update, if comment exists. Otherwise post new. + behavior: default + # Comments will only post when coverage changes. Furthermore, if a comment + # already exists, and a newer commit results in no coverage change for the + # entire pull, the comment will be deleted. + require_changes: true + require_base: yes # must have a base report to post + require_head: yes # must have a head report to post + diff --git a/EmpowerPlant.xcodeproj/project.pbxproj b/EmpowerPlant.xcodeproj/project.pbxproj index be5a210..22c682f 100644 --- a/EmpowerPlant.xcodeproj/project.pbxproj +++ b/EmpowerPlant.xcodeproj/project.pbxproj @@ -46,6 +46,7 @@ 846BEA1B2ABE611A0032F77F /* mobydick.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = mobydick.txt; sourceTree = ""; }; 8474F0482ACCE2D800F21E06 /* deploy_project.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = deploy_project.sh; sourceTree = ""; }; 8474F04D2ACE54F300F21E06 /* .github */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .github; sourceTree = ""; }; + 848A45262BBFC79E006AAAEC /* .codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .codecov.yml; sourceTree = ""; }; 84A264182AA9155800A62A88 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 84A264192AA915B100A62A88 /* Brewfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Brewfile; sourceTree = ""; }; 84A2641B2AA915D800A62A88 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; @@ -107,6 +108,7 @@ 840B7EF12BBF3C70008B8120 /* .slather.yml */, 84A264192AA915B100A62A88 /* Brewfile */, 84A264182AA9155800A62A88 /* Makefile */, + 848A45262BBFC79E006AAAEC /* .codecov.yml */, 84A2641B2AA915D800A62A88 /* README.md */, D17C73B127D8291D006650AF /* EmpowerPlant */, 8BA3AB2D2A201FE900BE1EA8 /* EmpowerPlantTests */,