Skip to content

Commit

Permalink
Project updates (#137)
Browse files Browse the repository at this point in the history
* ⬆️ Update CI

* 🔧 Bump deployment target to iOS 12

* 🔧 Update CI device

* 🚨 Fix lint warnings

* 🔧 Fix macOS deployment target

* 🔧 Upload result bundle for failed tests

* 🔧 Update host application for iOS tests

* 🔧 Install yeetd before tests

* 🔧 Comment out suspicious FC test

* 🔧 Try to fix flaky FC test

* 🔧 Improve CI jobs
  • Loading branch information
olejnjak authored Nov 3, 2023
1 parent 91d9094 commit 4f300a2
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Carthage
runs-on: macos-13
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: Build
run: carthage build --no-skip-current --cache-builds --use-xcframeworks
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
name: Swiftlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
changelog:
name: Changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- name: Changelog Reminder
uses: peterjgrainger/[email protected]
with:
Expand All @@ -26,7 +26,7 @@ jobs:
name: Podspec
runs-on: macos-13
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- name: Install Bundler dependencies
run: bundle install
- name: Lint podspec
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Upload Carthage binary
runs-on: macos-13
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- name: Build
run: carthage build --no-skip-current --cache-builds --use-xcframeworks
Expand All @@ -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 }}
Expand All @@ -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
- uses: AckeeCZ/[email protected]
- name: Install gems
run: bundle install
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ jobs:
name: Run tests
runs-on: macos-13
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
- uses: AckeeCZ/[email protected]
- 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 -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 -destination 'platform=OS X,arch=x86_64' | xcpretty
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
2 changes: 1 addition & 1 deletion .github/xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.3.1
15.0.1
2 changes: 1 addition & 1 deletion ACKategories-iOS/Base/FlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 4 additions & 4 deletions ACKategories-iOS/UINavigationControllerExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ final class FlowCoordinatorTests: XCTestCase {
}

override func tearDown() {
ErrorHandlers.rootViewControllerDeallocatedBeforeStop = nil
window = nil

super.tearDown()
Expand Down
4 changes: 2 additions & 2 deletions ACKategories.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Tools, cocoa subclasses and extensions we love to use at Ackee.
s.author = { 'Ackee' => '[email protected]' }
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.swift_version = '5.9'

s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'

s.source_files = 'ACKategoriesCore/**/*.swift'
Expand Down
14 changes: 7 additions & 7 deletions ACKategories.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1585,7 +1587,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",
Expand Down Expand Up @@ -1661,7 +1662,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",
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions ACKategoriesCore/BetterURL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -28,4 +28,3 @@ public struct BetterURL: RawRepresentable, Codable, Hashable {
}
}
}

2 changes: 1 addition & 1 deletion ACKategoriesCore/CollectionExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extension Collection {

extension Collection where Index: Strideable, Index.Stride: SignedInteger {
/// Return objects in given range
public subscript(safe range: CountableRange<Index>) -> Array<Element> {
public subscript(safe range: CountableRange<Index>) -> [Element] {
return range.compactMap { self[safe: $0] }
}
}
2 changes: 1 addition & 1 deletion ACKategoriesCore/DictionaryExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension Dictionary where Value: OptionalProtocol {
guard let key = key as? Key else {
return
}
result = (result as? Dictionary<Key, Value>)?[key]
result = (result as? [Key: Value])?[key]
}
return result as? T
}
Expand Down
2 changes: 1 addition & 1 deletion ACKategoriesCore/PropertyWrappers/UserDefault.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public final class UserDefault<Value: Codable> {
}

public extension UserDefault {
convenience init<Wrapped>(_ key: String, `default`: Optional<Wrapped> = nil, userDefaults: UserDefaults = .standard) where Value == Optional<Wrapped> {
convenience init<Wrapped>(_ key: String, `default`: Wrapped? = nil, userDefaults: UserDefaults = .standard) where Value == Wrapped? {
self.init(key, default: `default`, userDefaults: userDefaults)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ACKategoriesCore/PublisherExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ extension Publishers {
zipped.subscribe(subscriber)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 3 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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"]),
Expand All @@ -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
]
)
9 changes: 0 additions & 9 deletions TapestryConfig.swift

This file was deleted.

0 comments on commit 4f300a2

Please sign in to comment.