Skip to content

Commit

Permalink
Add Xcode 13 and iOS 15 support (#17415)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio authored Nov 10, 2021
2 parents 9004f98 + d27e39b commit 0f03ee0
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .buildkite/cache-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ common_params:
repo: "wordpress-mobile/wordpress-ios/"
# Common environment values to use with the `env` key.
- &common_env
IMAGE_ID: xcode-12.5.1
IMAGE_ID: xcode-13

steps:

#################
# Build the CocoaPods Base Cache
#
#
# This prevents the base cache from infinite growth caused by storing every
# version of every pod we've ever used.
#################
Expand Down
4 changes: 4 additions & 0 deletions .buildkite/commands/build-for-testing.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash -eu

# FIXIT-13.1: Temporary fix until we're on the Xcode 13.1 VM
echo "--- :rubygems: Fixing Ruby Setup"
gem install bundler

echo "--- :rubygems: Setting up Gems"
restore_cache "$(hash_file .ruby-version)-$(hash_file Gemfile.lock)"
install_gems
Expand Down
4 changes: 4 additions & 0 deletions .buildkite/commands/run-ui-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ echo "--- :wrench: Fixing VM"
brew install openjdk@11
sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk

# Temporary fix until we're on the Xcode 13.1 VM
echo "--- :rubygems: Fixing Ruby Setup"
gem install bundler

echo "--- :rubygems: Setting up Gems"
install_gems

Expand Down
4 changes: 4 additions & 0 deletions .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ echo "--- 📦 Downloading Build Artifacts"
download_artifact build-products.tar
tar -xf build-products.tar

# Temporary fix until we're on the Xcode 13.1 VM
echo "--- :rubygems: Fixing Ruby Setup"
gem install bundler

echo "--- :rubygems: Setting up Gems"
install_gems

Expand Down
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common_params:
repo: "wordpress-mobile/wordpress-ios/"
# Common environment values to use with the `env` key.
- &common_env
IMAGE_ID: xcode-12.5.1
IMAGE_ID: xcode-13 # Remember to address all 'FIXIT-13.1' comments when we'll update to new image

# This is the default pipeline – it will build and test the app
steps:
Expand Down Expand Up @@ -45,7 +45,7 @@ steps:
# UI Tests
#################
- label: "🧪 UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh WordPressUITests 'iPhone 11' 14.1
command: .buildkite/commands/run-ui-tests.sh WordPressUITests 'iPhone 13' 15.0
depends_on: "build"
env: *common_env
plugins: *common_plugins
Expand All @@ -54,7 +54,7 @@ steps:


- label: "🧪 UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh WordPressUITests "iPad Air (4th generation)" 14.1
command: .buildkite/commands/run-ui-tests.sh WordPressUITests "iPad Air (4th generation)" 15.0
depends_on: "build"
env: *common_env
plugins: *common_plugins
Expand Down
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ parameters:
default: false

xcode_version: &xcode_version
xcode-version: "12.5.0"
xcode-version: "13.0.0"

iphone_test_device: &iphone_test_device
device: iPhone 11
ios-version: "14.4"
device: iPhone 12
ios-version: "15.0"

ipad_test_device: &ipad_test_device
device: iPad Air (4th generation)
ios-version: "14.4"
ios-version: "15.0"

commands:
fix-image:
Expand All @@ -39,7 +39,7 @@ commands:
echo $PATH
fi
chruby ruby-2.6.6
chruby ruby-$(cat .ruby-version)
gem install bundler
# Prevent fastlane from checking for updates, also removing the verbose fastlane changelog at the end of each invocation.
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.4
2.7.4
2 changes: 1 addition & 1 deletion .xcversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.5
13.0
93 changes: 48 additions & 45 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.3)
CFPropertyList (3.0.4)
rexml
activesupport (5.2.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
Expand All @@ -14,21 +15,21 @@ GEM
json (>= 1.5.1)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.1.1)
aws-partitions (1.465.0)
aws-sdk-core (3.114.1)
aws-eventstream (1.2.0)
aws-partitions (1.509.0)
aws-sdk-core (3.121.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.43.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (1.48.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.96.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-s3 (1.103.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.3)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
bigdecimal (1.4.4)
Expand Down Expand Up @@ -81,16 +82,16 @@ GEM
concurrent-ruby (1.1.9)
declarative (0.0.20)
diffy (3.4.0)
digest-crc (0.6.3)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.2)
emoji_regex (3.2.3)
escape (0.0.4)
ethon (0.14.0)
ffi (>= 1.15.0)
excon (0.82.0)
excon (0.85.0)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand All @@ -113,12 +114,12 @@ GEM
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday_middleware (1.0.0)
faraday_middleware (1.1.0)
faraday (~> 1.0)
fastimage (2.2.4)
fastlane (2.184.1)
fastimage (2.2.5)
fastlane (2.195.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
Expand All @@ -133,7 +134,7 @@ GEM
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.1)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
Expand All @@ -142,6 +143,7 @@ GEM
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
Expand Down Expand Up @@ -182,47 +184,46 @@ GEM
gh_inspector (1.1.3)
git (1.9.1)
rchardet (~> 1.8)
google-apis-androidpublisher_v3 (0.5.0)
google-apis-core (~> 0.1)
google-apis-core (0.3.0)
google-apis-androidpublisher_v3 (0.11.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.14)
httpclient (>= 2.8.1, < 3.0)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
retriable (>= 2.0, < 4.a)
rexml
signet (~> 0.14)
webrick
google-apis-iamcredentials_v1 (0.4.0)
google-apis-core (~> 0.1)
google-apis-playcustomapp_v1 (0.3.0)
google-apis-core (~> 0.1)
google-apis-storage_v1 (0.4.0)
google-apis-core (~> 0.1)
google-apis-iamcredentials_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.8.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.1.0)
google-cloud-storage (1.31.1)
google-cloud-errors (1.2.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (0.16.2)
googleauth (1.0.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.8.10)
Expand All @@ -235,7 +236,7 @@ GEM
jwt (2.2.3)
memoist (0.16.2)
mini_magick (4.11.0)
mini_mime (1.1.0)
mini_mime (1.1.1)
mini_portile2 (2.6.1)
minitest (5.14.4)
molinillo (0.6.6)
Expand All @@ -254,6 +255,7 @@ GEM
oj (3.13.9)
optimist (3.0.1)
options (2.3.2)
optparse (0.1.1)
os (1.1.1)
parallel (1.21.0)
plist (3.6.0)
Expand All @@ -278,13 +280,13 @@ GEM
i18n
ruby-macho (1.4.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.0)
rubyzip (2.3.2)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
security (0.1.3)
signet (0.15.0)
addressable (~> 2.3)
signet (0.16.0)
addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
Expand All @@ -310,16 +312,17 @@ GEM
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
unf_ext (0.0.8)
unicode-display_width (1.8.0)
webrick (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.19.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,26 @@ extension WPStyleGuide {
buttonBarAppearance.tintColor = .appBarTint
}

/// Style `UITableView` in the app
class func configureTableViewAppearance() {
if #available(iOS 15.0, *) {
UITableView.appearance().sectionHeaderTopPadding = 0
}
}

/// Style the tab bar using Muriel colors
class func configureTabBarAppearance() {
UITabBar.appearance().tintColor = .tabSelected
UITabBar.appearance().unselectedItemTintColor = .tabUnselected

if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .systemBackground

UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
}

/// Style the `LightNavigationController` UINavigationBar and BarButtonItems
Expand Down
1 change: 1 addition & 0 deletions WordPress/Classes/System/WordPressAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ extension WordPressAppDelegate {

WPStyleGuide.configureTabBarAppearance()
WPStyleGuide.configureNavigationAppearance()
WPStyleGuide.configureTableViewAppearance()
WPStyleGuide.configureDefaultTint()
WPStyleGuide.configureLightNavigationBarAppearance()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class UserProfileSheetViewController: UITableViewController {
size.height += bottomPadding

preferredContentSize = size
presentedVC?.presentedView?.layoutIfNeeded()
}
}

Expand Down
10 changes: 10 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -844,13 +844,23 @@ platform :ios do
UI.user_error!("Unable to find .xctestrun file at #{build_products_path}")
end

# Because of what is likely a bug in `multi_scan`, we need to exclude
# certain tests from the execution.
#
# See more details at:
# - https://github.com/wordpress-mobile/WordPress-iOS/pull/17233#issuecomment-954897098
# - https://github.com/lyndsey-ferguson/fastlane-plugin-test_center/issues/358
all_tests = tests_from_xctestrun(xctestrun: test_plan_path)
only_testing = all_tests["WordPressTest"].reject { |t| t.include?("ContextManagerMock") || t.include?("TestContextManager") || t.include?("OCMLocation") || t.include?("HTTPStubsDescriptor") }

multi_scan(
workspace: WORKSPACE_PATH,
scheme: 'WordPress',
device: options[:device],
deployment_target_version: options[:ios_version],
ensure_devices_found: true,
test_without_building: true,
only_testing: only_testing,
xctestrun: test_plan_path,
try_count: options[:try_count],
output_directory: File.join(PROJECT_ROOT_FOLDER, 'build', 'results'),
Expand Down

0 comments on commit 0f03ee0

Please sign in to comment.