Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Xcode 15.4 #56

Merged
merged 14 commits into from
Jun 12, 2024
28 changes: 10 additions & 18 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ jobs:
uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Force Xcode 12.4
run: sudo xcode-select -switch /Applications/Xcode_12.4.app
- name: List available simulators
run: xcrun simctl list
- name: Force Xcode 15.4
run: sudo xcode-select -switch /Applications/Xcode_15.4.app
- name: Make project
run: make generate
- name: Run tests
Expand All @@ -29,32 +27,26 @@ jobs:
uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Force Xcode 12.4
run: sudo xcode-select -switch /Applications/Xcode_12.4.app
- name: Force Xcode 15.4
run: sudo xcode-select -switch /Applications/Xcode_15.4.app
- name: List available simulators
run: xcrun simctl list
- name: Make project
run: make generate
- name: Run tests
run: make test-iPhone
test_iphone_ios12:
name: Test-iPhone-iOS12
runs-on: macos-10.15
test_iphone_ios15:
name: Test-iPhone-iOS15
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Force Xcode 12.4
run: sudo xcode-select -switch /Applications/Xcode_12.4.app
- name: Setup Simulator
run: |
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s /Applications/Xcode_10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 12.4.simruntime
- name: List available simulators
run: xcrun simctl list
- name: Force Xcode 13.1
run: sudo xcode-select -switch /Applications/Xcode_13.1.app
- name: Make project
run: make generate
- name: Run tests
run: make test-iPhone-iOS12
run: make test-iPhone-iOS15

4 changes: 2 additions & 2 deletions HammerTests.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |spec|
spec.name = "HammerTests"
spec.version = "0.14.3"
spec.version = "0.14.4"
spec.summary = "iOS touch and keyboard syntheis library for unit tests."
spec.description = "Hammer is a touch and keyboard synthesis library for emulating user interaction events. It enables new ways of triggering UI actions in unit tests, replicating a real world environment as much as possible."
spec.homepage = "https://github.com/lyft/Hammer"
spec.screenshots = "https://user-images.githubusercontent.com/585835/116217617-ab410080-a6fe-11eb-9de1-3d42f7dd6037.gif"
spec.license = { :type => "Apache License, Version 2.0", :file => "./LICENSE" }
spec.author = { "Gabriel Lanata" => "gabriel@lanata.me" }
spec.platform = :ios, "11.0"
spec.platform = :ios, "12.0"
spec.swift_version = "5.3"
spec.frameworks = 'XCTest'
spec.source = { :git => "https://github.com/lyft/Hammer.git", :tag => "#{spec.version}" }
Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.DEFAULT_GOAL := generate

# Code Signing Settings

NO_CODE_SIGN_SETTINGS = CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I was trying to do that in different place fa673da
Thank you!


# Install Tasks

install-lint:
Expand All @@ -23,24 +27,28 @@ test-iPad:
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPad Pro (12.9-inch) (4th generation)" \
test
-destination "name=iPad Pro (12.9-inch) (6th generation)" \
test \
$(NO_CODE_SIGN_SETTINGS)

test-iPhone:
set -o pipefail && \
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPhone 11" \
test
-destination "name=iPhone 15" \
test \
$(NO_CODE_SIGN_SETTINGS)

test-iPhone-iOS12:
test-iPhone-iOS15:
set -o pipefail && \
xcodebuild \
-project Hammer.xcodeproj \
-scheme Hammer \
-destination "name=iPhone 6" \
test
-destination "name=iPhone 11" \
-sdk iphonesimulator15.0 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a bit unfortunate but GitHub Actions deprecated the macos_11 runner which would let us test all the way to iOS 13.7. We can figure out alternatives if this is critical but we'd need to download and install a large runtime file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine

test \
$(NO_CODE_SIGN_SETTINGS)

# List all targets (from https://stackoverflow.com/questions/4219255/how-do-you-get-the-list-of-targets-in-a-makefile)

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "Hammer",
platforms: [
.iOS(.v11),
.iOS(.v12),
],
products: [
.library(name: "Hammer", targets: ["Hammer"]),
Expand Down
2 changes: 2 additions & 0 deletions Sources/Hammer/AppleInternal/AppleInternal+IOHID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ extension IOHID {

let kGSEventPathInfoInRange: UInt8 = (1 << 0)
let kGSEventPathInfoInTouch: UInt8 = (1 << 1)

// swiftlint:enable type_name
6 changes: 2 additions & 4 deletions Sources/Hammer/Utilties/Subviews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,8 @@ extension EventGenerator {
throw HammerError.windowIsNotReadyForInteraction
}

for point in points {
if !self.pointIsHittable(point) {
throw HammerError.pointIsNotHittable(point)
}
if let nonHittablePoint = points.first(where: { !self.pointIsHittable($0) }) {
throw HammerError.pointIsNotHittable(nonHittablePoint)
}
}

Expand Down
6 changes: 3 additions & 3 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ targets:
Hammer:
type: framework
platform: iOS
deploymentTarget: "11.0"
deploymentTarget: "12.0"
sources: Sources/Hammer
settings:
ENABLE_TESTING_SEARCH_PATHS: true
Expand All @@ -18,13 +18,13 @@ targets:
HammerTests:
type: bundle.unit-test
platform: iOS
deploymentTarget: "11.0"
deploymentTarget: "12.0"
sources: Tests/HammerTests
dependencies:
- target: Hammer
- target: TestHost
TestHost:
type: application
platform: iOS
deploymentTarget: "11.0"
deploymentTarget: "12.0"
sources: TestHost
Loading