From 5ef618c2f70fe366ac109fc2efb6d72bddc2e664 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 20:39:45 +0100 Subject: [PATCH 01/11] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .github/workflows/checks.yml | 6 +++--- .github/workflows/deploy.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/stale.yml | 2 +- .github/workflows/tests.yml | 2 +- .github/xcode-version | 2 +- TapestryConfig.swift | 9 --------- 8 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 TapestryConfig.swift diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a30a8150..e227c0d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: name: Carthage runs-on: macos-13 steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Build run: carthage build --no-skip-current --cache-builds --use-xcframeworks diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7dbc8958..0e4f6b3a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,14 +8,14 @@ jobs: name: Swiftlint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - name: GitHub Action for SwiftLint uses: norio-nomura/action-swiftlint@3.1.0 changelog: name: Changelog runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - name: Changelog Reminder uses: peterjgrainger/action-changelog-reminder@v1.2.0 with: @@ -26,7 +26,7 @@ jobs: name: Podspec runs-on: macos-13 steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - name: Install Bundler dependencies run: bundle install - name: Lint podspec diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0c7dc43d..c859bfb8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,7 @@ jobs: name: Upload Carthage binary runs-on: macos-13 steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Build run: carthage build --no-skip-current --cache-builds --use-xcframeworks @@ -21,7 +21,7 @@ jobs: mv Carthage/Build/*.xcframework /tmp/ACKategories cd /tmp zip -r "$DST/"ACKategories.xcframework.zip ACKategories - - uses: xresloader/upload-to-github-release@v1 + - uses: xresloader/upload-to-github-release@v1.3.12 if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -33,7 +33,7 @@ jobs: name: Push podspec to Cocoapods trunk runs-on: macos-13 steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Install gems run: bundle install diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ddada384..d24b2955 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - name: Generate Documentation uses: SwiftDocOrg/swift-doc@master with: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index f5151594..00b0c2a9 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a73873f..ea37ab10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: name: Run tests runs-on: macos-13 steps: - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Run iOS tests run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=latest' ONLY_ACTIVE_ARCH=YES | xcpretty diff --git a/.github/xcode-version b/.github/xcode-version index 7ea95c24..9dc738e6 100644 --- a/.github/xcode-version +++ b/.github/xcode-version @@ -1 +1 @@ -14.3.1 \ No newline at end of file +15.0.1 \ No newline at end of file diff --git a/TapestryConfig.swift b/TapestryConfig.swift deleted file mode 100644 index 375b0a12..00000000 --- a/TapestryConfig.swift +++ /dev/null @@ -1,9 +0,0 @@ -import PackageDescription - -let config = TapestryConfig(release: Release(actions: [.pre(.docsUpdate), - .pre(.dependenciesCompatibility([.cocoapods, .carthage, .spm(.all)]))], - add: ["README.md", - "ACKategories.podspec", - "CHANGELOG.md"], - commitMessage: "Version \(Argument.version)", - push: true)) From f8277018947e8481373792b9d68cd05df66e60e4 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 20:44:42 +0100 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=94=A7=20Bump=20deployment=20target?= =?UTF-8?q?=20to=20iOS=2012?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories.podspec | 3 +-- ACKategories.xcodeproj/project.pbxproj | 12 +++++------- Package.swift | 9 +++------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ACKategories.podspec b/ACKategories.podspec index 74daa1a4..7742b001 100644 --- a/ACKategories.podspec +++ b/ACKategories.podspec @@ -10,9 +10,8 @@ Tools, cocoa subclasses and extensions we love to use at Ackee. s.author = { 'Ackee' => 'info@ackee.cz' } s.source = { :git => 'https://github.com/AckeeCZ/ACKategories.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/ackeecz' - s.swift_version = '5.1.3' - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.13' s.source_files = 'ACKategoriesCore/**/*.swift' diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index 7bdaf097..531a04e3 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1189,6 +1189,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 6.12.3; ONLY_ACTIVE_ARCH = YES; SWIFT_VERSION = 5.0; @@ -1225,6 +1227,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 6.12.3; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_VERSION = 5.0; @@ -1298,7 +1302,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1374,7 +1377,6 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = cz.ackee.enterprise.ACKategoriesCore; @@ -1448,7 +1450,6 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1514,7 +1515,6 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = cz.ackee.enterprise.ACKategoriesCoreTests; @@ -1585,7 +1585,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1661,7 +1660,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Package.swift b/Package.swift index 211a3570..28af7ff9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,11 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.9 import PackageDescription let package = Package( name: "ACKategories", platforms: [ - .iOS(.v11), - .macOS("10.13") + .iOS(.v12), + .macOS(.v10_13) ], products: [ .library(name: "ACKategories", targets: ["ACKategories-iOS"]), @@ -16,8 +16,5 @@ let package = Package( .testTarget(name: "ACKategories-iOSTests", dependencies: ["ACKategories-iOS"], path: "ACKategories-iOSTests"), .target(name: "ACKategoriesCore", path: "ACKategoriesCore"), .testTarget(name: "ACKategoriesCoreTests", dependencies: ["ACKategoriesCore"], path: "ACKategoriesCoreTests"), - ], - swiftLanguageVersions: [ - .v5 ] ) From c03a113b8ce7cc20c0b76c04487a0710e81e6e3e Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 20:48:14 +0100 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=94=A7=20Update=20CI=20device?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 2 +- ACKategories.podspec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea37ab10..342f389e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,6 +10,6 @@ jobs: - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Run iOS tests - run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=latest' ONLY_ACTIVE_ARCH=YES | xcpretty + run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=latest' ONLY_ACTIVE_ARCH=YES | xcpretty - name: Run macOS tests run: set -o pipefail && xcodebuild test -scheme ACKategoriesCore -destination 'platform=OS X,arch=x86_64' | xcpretty \ No newline at end of file diff --git a/ACKategories.podspec b/ACKategories.podspec index 7742b001..9a801e45 100644 --- a/ACKategories.podspec +++ b/ACKategories.podspec @@ -10,6 +10,7 @@ Tools, cocoa subclasses and extensions we love to use at Ackee. s.author = { 'Ackee' => 'info@ackee.cz' } s.source = { :git => 'https://github.com/AckeeCZ/ACKategories.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/ackeecz' + s.swift_version = '5.9' s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.13' From 9aa56666fef831883e41ad0c138019fbc7be1ea7 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 21:03:20 +0100 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20lint=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories-iOS/Base/FlowCoordinator.swift | 2 +- ACKategories-iOS/UINavigationControllerExtensions.swift | 8 ++++---- ACKategoriesCore/BetterURL.swift | 5 ++--- ACKategoriesCore/CollectionExtensions.swift | 2 +- ACKategoriesCore/DictionaryExtensions.swift | 2 +- ACKategoriesCore/PropertyWrappers/UserDefault.swift | 2 +- ACKategoriesCore/PublisherExtensions.swift | 2 +- .../VC composition/VCCompositionViewController.swift | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ACKategories-iOS/Base/FlowCoordinator.swift b/ACKategories-iOS/Base/FlowCoordinator.swift index 6ebef631..904d0d2b 100644 --- a/ACKategories-iOS/Base/FlowCoordinator.swift +++ b/ACKategories-iOS/Base/FlowCoordinator.swift @@ -25,7 +25,7 @@ extension Base { } /// When flow coordinator handles modally presented flow, we are interested `rootVC` changes - private var rootVCSetter: (UIViewController?) -> () = { _ in } + private var rootVCSetter: (UIViewController?) -> Void = { _ in } /// Parent coordinator public weak var parentCoordinator: FlowCoordinator? diff --git a/ACKategories-iOS/UINavigationControllerExtensions.swift b/ACKategories-iOS/UINavigationControllerExtensions.swift index bf3f1510..98d05997 100644 --- a/ACKategories-iOS/UINavigationControllerExtensions.swift +++ b/ACKategories-iOS/UINavigationControllerExtensions.swift @@ -8,28 +8,28 @@ import UIKit public extension UINavigationController { - func pushViewController(_ viewController: UIViewController, animated: Bool, completion: @escaping () -> ()) { + func pushViewController(_ viewController: UIViewController, animated: Bool, completion: @escaping () -> Void) { CATransaction.begin() CATransaction.setCompletionBlock(completion) pushViewController(viewController, animated: animated) CATransaction.commit() } - func popViewController(animated: Bool, completion: @escaping () -> ()) { + func popViewController(animated: Bool, completion: @escaping () -> Void) { CATransaction.begin() CATransaction.setCompletionBlock(completion) popViewController(animated: animated) CATransaction.commit() } - func popToViewController(_ viewController: UIViewController, animated: Bool, completion: @escaping () -> ()) { + func popToViewController(_ viewController: UIViewController, animated: Bool, completion: @escaping () -> Void) { CATransaction.begin() CATransaction.setCompletionBlock(completion) popToViewController(viewController, animated: animated) CATransaction.commit() } - func popToRootViewController(animated: Bool, completion: @escaping () -> ()) { + func popToRootViewController(animated: Bool, completion: @escaping () -> Void) { CATransaction.begin() CATransaction.setCompletionBlock(completion) popToRootViewController(animated: animated) diff --git a/ACKategoriesCore/BetterURL.swift b/ACKategoriesCore/BetterURL.swift index 811f7bb1..750eba74 100644 --- a/ACKategoriesCore/BetterURL.swift +++ b/ACKategoriesCore/BetterURL.swift @@ -11,14 +11,14 @@ public struct BetterURL: RawRepresentable, Codable, Hashable { public init?(rawValue: String) { self.rawValue = rawValue - + var replacedURLString: String { rawValue .replacingOccurrences(of: " ", with: "%20") .replacingOccurrences(of: "{", with: "%7B") .replacingOccurrences(of: "}", with: "%7D") } - + if let url = URL(string: rawValue) { self.url = url } else if let url = URL(string: replacedURLString) { @@ -28,4 +28,3 @@ public struct BetterURL: RawRepresentable, Codable, Hashable { } } } - diff --git a/ACKategoriesCore/CollectionExtensions.swift b/ACKategoriesCore/CollectionExtensions.swift index 66626074..d0e406c7 100644 --- a/ACKategoriesCore/CollectionExtensions.swift +++ b/ACKategoriesCore/CollectionExtensions.swift @@ -41,7 +41,7 @@ extension Collection { extension Collection where Index: Strideable, Index.Stride: SignedInteger { /// Return objects in given range - public subscript(safe range: CountableRange) -> Array { + public subscript(safe range: CountableRange) -> [Element] { return range.compactMap { self[safe: $0] } } } diff --git a/ACKategoriesCore/DictionaryExtensions.swift b/ACKategoriesCore/DictionaryExtensions.swift index 712f7f41..56e59d02 100644 --- a/ACKategoriesCore/DictionaryExtensions.swift +++ b/ACKategoriesCore/DictionaryExtensions.swift @@ -38,7 +38,7 @@ extension Dictionary where Value: OptionalProtocol { guard let key = key as? Key else { return } - result = (result as? Dictionary)?[key] + result = (result as? [Key: Value])?[key] } return result as? T } diff --git a/ACKategoriesCore/PropertyWrappers/UserDefault.swift b/ACKategoriesCore/PropertyWrappers/UserDefault.swift index eb061226..7790044a 100644 --- a/ACKategoriesCore/PropertyWrappers/UserDefault.swift +++ b/ACKategoriesCore/PropertyWrappers/UserDefault.swift @@ -95,7 +95,7 @@ public final class UserDefault { } public extension UserDefault { - convenience init(_ key: String, `default`: Optional = nil, userDefaults: UserDefaults = .standard) where Value == Optional { + convenience init(_ key: String, `default`: Wrapped? = nil, userDefaults: UserDefaults = .standard) where Value == Wrapped? { self.init(key, default: `default`, userDefaults: userDefaults) } } diff --git a/ACKategoriesCore/PublisherExtensions.swift b/ACKategoriesCore/PublisherExtensions.swift index 248517ec..d4511fd1 100644 --- a/ACKategoriesCore/PublisherExtensions.swift +++ b/ACKategoriesCore/PublisherExtensions.swift @@ -63,4 +63,4 @@ extension Publishers { zipped.subscribe(subscriber) } } -} \ No newline at end of file +} diff --git a/ACKategoriesExample/Screens/VC composition/VCCompositionViewController.swift b/ACKategoriesExample/Screens/VC composition/VCCompositionViewController.swift index 6858b789..e7c00ea1 100644 --- a/ACKategoriesExample/Screens/VC composition/VCCompositionViewController.swift +++ b/ACKategoriesExample/Screens/VC composition/VCCompositionViewController.swift @@ -32,7 +32,7 @@ final class VCCompositionViewController: TitleViewController { containerView.topAnchor.constraint(equalTo: nameLabel.bottomAnchor, constant: 30), containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), containerView.trailingAnchor.constraint(equalTo: view.trailingAnchor), - containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) let childVC = TitleViewController(name: "Child", color: .blue) From e50659fccf7b52d412bf769885f213f94d2f739d Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 21:24:02 +0100 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=94=A7=20Fix=20macOS=20deployment?= =?UTF-8?q?=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index 531a04e3..63638143 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -1450,6 +1450,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1515,6 +1516,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = cz.ackee.enterprise.ACKategoriesCoreTests; From d596099a5442cef1683d00f966fe9920549093af Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 22:02:00 +0100 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=94=A7=20Upload=20result=20bundle?= =?UTF-8?q?=20for=20failed=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 342f389e..bef3f0a7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,6 +10,18 @@ jobs: - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Run iOS tests - run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=latest' ONLY_ACTIVE_ARCH=YES | xcpretty + env: + DEVICE: iPhone 15 Pro Max + run: | + xcrun simctl boot "$DEVICE" + set -o pipefail && xcodebuild test -scheme ACKategories-iOS -resultBundlePath Tests-iOS.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=$DEVICE,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty + - uses: actions/upload-artifact@v3 + if: failure() + with: + path: Tests-iOS.xcresult - name: Run macOS tests - run: set -o pipefail && xcodebuild test -scheme ACKategoriesCore -destination 'platform=OS X,arch=x86_64' | xcpretty \ No newline at end of file + run: set -o pipefail && xcodebuild test -scheme ACKategoriesCore -resultBundlePath Tests-macOS.xcresult -destination 'platform=OS X,arch=x86_64' | xcpretty + - uses: actions/upload-artifact@v3 + if: failure() + with: + path: Tests-macOS.xcresult \ No newline at end of file From 97c7218c33331d9ca58abbf6f4bba9cafff885a4 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 23:36:32 +0100 Subject: [PATCH 07/11] =?UTF-8?q?=F0=9F=94=A7=20Update=20host=20applicatio?= =?UTF-8?q?n=20for=20iOS=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index 63638143..d8a58e57 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -1751,7 +1751,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ACKategoriesExample.app/ACKategoriesExample"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ACKategoriesExample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ACKategoriesExample"; }; name = Debug; }; @@ -1816,7 +1816,7 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ACKategoriesExample.app/ACKategoriesExample"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ACKategoriesExample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ACKategoriesExample"; VALIDATE_PRODUCT = YES; }; name = Release; From ba9e71de0f4603e02ed11ab4b8b11afe6d370ba9 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Thu, 2 Nov 2023 23:56:49 +0100 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=94=A7=20Install=20yeetd=20before?= =?UTF-8?q?=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bef3f0a7..8ae45d22 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,6 +9,11 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - uses: AckeeCZ/load-xcode-version@1.1.0 + - name: Install yeetd + run: | + wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg + sudo installer -pkg yeetd-normal.pkg -target / + yeetd & - name: Run iOS tests env: DEVICE: iPhone 15 Pro Max From f5ec6e4f21c5917c4cb9a31e9f24eb0b9c732c7d Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Fri, 3 Nov 2023 04:12:40 +0100 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=94=A7=20Comment=20out=20suspicious?= =?UTF-8?q?=20FC=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlowCoordinatorTests.swift | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift b/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift index f0e45849..e4189676 100644 --- a/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift +++ b/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift @@ -202,19 +202,19 @@ final class FlowCoordinatorTests: XCTestCase { wait(for: [exp], timeout: 0.3) } - func testErrorCallbackIsCalled() { - let rootExp = expectation(description: "Root is deallocated") - ErrorHandlers.rootViewControllerDeallocatedBeforeStop = { rootExp.fulfill() } - - let fc = NavigationFC() - fc.start(in: window) - _ = fc.rootViewController.view - fc.rootViewController = nil - - let exp = expectation(description: "Flow did finish") - fc.stop(animated: false) { exp.fulfill() } - wait(for: [exp, rootExp], timeout: 0.3) - } +// func testErrorCallbackIsCalled() { +// let rootExp = expectation(description: "Root is deallocated") +// ErrorHandlers.rootViewControllerDeallocatedBeforeStop = { rootExp.fulfill() } +// +// let fc = NavigationFC() +// fc.start(in: window) +// _ = fc.rootViewController.view +// fc.rootViewController = nil +// +// let exp = expectation(description: "Flow did finish") +// fc.stop(animated: false) { exp.fulfill() } +// wait(for: [exp, rootExp], timeout: 0.3) +// } func testAllChildCoordinatorsAreCorrectlyStoppedWhenPreseting() throws { let fc = NavigationFC() From 778bcc5e45fa50679924f7e33e91bcd72b2b0f5b Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Fri, 3 Nov 2023 10:53:35 +0100 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=94=A7=20Try=20to=20fix=20flaky=20F?= =?UTF-8?q?C=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlowCoordinatorTests.swift | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift b/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift index e4189676..3549b514 100644 --- a/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift +++ b/ACKategories-iOSTests/FlowCoordinator/FlowCoordinatorTests.swift @@ -22,6 +22,7 @@ final class FlowCoordinatorTests: XCTestCase { } override func tearDown() { + ErrorHandlers.rootViewControllerDeallocatedBeforeStop = nil window = nil super.tearDown() @@ -202,19 +203,19 @@ final class FlowCoordinatorTests: XCTestCase { wait(for: [exp], timeout: 0.3) } -// func testErrorCallbackIsCalled() { -// let rootExp = expectation(description: "Root is deallocated") -// ErrorHandlers.rootViewControllerDeallocatedBeforeStop = { rootExp.fulfill() } -// -// let fc = NavigationFC() -// fc.start(in: window) -// _ = fc.rootViewController.view -// fc.rootViewController = nil -// -// let exp = expectation(description: "Flow did finish") -// fc.stop(animated: false) { exp.fulfill() } -// wait(for: [exp, rootExp], timeout: 0.3) -// } + func testErrorCallbackIsCalled() { + let rootExp = expectation(description: "Root is deallocated") + ErrorHandlers.rootViewControllerDeallocatedBeforeStop = { rootExp.fulfill() } + + let fc = NavigationFC() + fc.start(in: window) + _ = fc.rootViewController.view + fc.rootViewController = nil + + let exp = expectation(description: "Flow did finish") + fc.stop(animated: false) { exp.fulfill() } + wait(for: [exp, rootExp], timeout: 0.3) + } func testAllChildCoordinatorsAreCorrectlyStoppedWhenPreseting() throws { let fc = NavigationFC() From 0d23d0598561fb6a1636abcf914455557b17b7d8 Mon Sep 17 00:00:00 2001 From: Jakub Olejnik Date: Fri, 3 Nov 2023 11:52:01 +0100 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=94=A7=20Improve=20CI=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .github/workflows/checks.yml | 6 +++--- .github/workflows/deploy.yml | 4 ++-- .github/workflows/docs.yml | 29 ----------------------------- .github/workflows/tests.yml | 15 ++++----------- 5 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e227c0d4..cd68efc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: name: Carthage runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Build run: carthage build --no-skip-current --cache-builds --use-xcframeworks diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0e4f6b3a..1f3dccdc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,14 +8,14 @@ jobs: name: Swiftlint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - name: GitHub Action for SwiftLint uses: norio-nomura/action-swiftlint@3.1.0 changelog: name: Changelog runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - name: Changelog Reminder uses: peterjgrainger/action-changelog-reminder@v1.2.0 with: @@ -26,7 +26,7 @@ jobs: name: Podspec runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - name: Install Bundler dependencies run: bundle install - name: Lint podspec diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c859bfb8..d41e012b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,7 @@ jobs: name: Upload Carthage binary runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Build run: carthage build --no-skip-current --cache-builds --use-xcframeworks @@ -33,7 +33,7 @@ jobs: name: Push podspec to Cocoapods trunk runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - uses: AckeeCZ/load-xcode-version@1.1.0 - name: Install gems run: bundle install diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index d24b2955..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Documentation - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4.1.1 - - name: Generate Documentation - uses: SwiftDocOrg/swift-doc@master - with: - inputs: "ACKategories-iOS" - output: "Documentation" - - name: Generate Documentation - uses: SwiftDocOrg/swift-doc@master - with: - inputs: "ACKategoriesCore" - output: "Documentation" - - name: Upload Documentation to Wiki - uses: SwiftDocOrg/github-wiki-publish-action@master - with: - path: "Documentation" - env: - GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ae45d22..a69e5b5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,26 +7,19 @@ jobs: name: Run tests runs-on: macos-13 steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 - uses: AckeeCZ/load-xcode-version@1.1.0 - - name: Install yeetd - run: | - wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg - sudo installer -pkg yeetd-normal.pkg -target / - yeetd & - name: Run iOS tests - env: - DEVICE: iPhone 15 Pro Max - run: | - xcrun simctl boot "$DEVICE" - set -o pipefail && xcodebuild test -scheme ACKategories-iOS -resultBundlePath Tests-iOS.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=$DEVICE,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty + run: set -o pipefail && xcodebuild test -scheme ACKategories-iOS -resultBundlePath Tests-iOS.xcresult -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 15 Pro Max,OS=latest" ONLY_ACTIVE_ARCH=YES | xcpretty - uses: actions/upload-artifact@v3 if: failure() with: + name: Tests-iOS.xcresult path: Tests-iOS.xcresult - name: Run macOS tests run: set -o pipefail && xcodebuild test -scheme ACKategoriesCore -resultBundlePath Tests-macOS.xcresult -destination 'platform=OS X,arch=x86_64' | xcpretty - uses: actions/upload-artifact@v3 if: failure() with: + name: Tests-macOS.xcresult path: Tests-macOS.xcresult \ No newline at end of file