diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6267e1f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +language: swift +osx_image: xcode11.3 + +cache: bundler + +jobs: + include: + - stage: build + name: "Building iOS" + script: bundle exec fastlane build_framework platform:'iOS' + + - stage: build + name: "Building tvOS" + script: bundle exec fastlane build_framework platform:'tvOS' + + - stage: build + name: "Building example app" + script: bundle exec fastlane build_example_app ios_version:'13.2' + + - stage: test + name: "Running example app UI tests suite" + script: bundle exec fastlane run_uiTests device:'iPhone 8' + + - stage: deploy_pod + name: "Deploying pod to Trunk" + script: bundle exec fastlane deploy_pod + +stages: +- name: build + if: (type = pull_request OR type = push) AND branch = master + +- name: test + if: (type = pull_request OR type = push) AND branch = master + +- name: deploy_pod + if: type = push AND tag IS present diff --git a/ContainerCollection.xcodeproj/project.pbxproj b/ContainerCollection.xcodeproj/project.pbxproj index e4b2b5d..5fb190a 100644 --- a/ContainerCollection.xcodeproj/project.pbxproj +++ b/ContainerCollection.xcodeproj/project.pbxproj @@ -1016,6 +1016,7 @@ PRODUCT_BUNDLE_IDENTIFIER = wearemobilefirst.ContainerCollection; PRODUCT_NAME = ContainerCollection; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1042,6 +1043,7 @@ PRODUCT_BUNDLE_IDENTIFIER = wearemobilefirst.ContainerCollection; PRODUCT_NAME = ContainerCollection; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/ContainerCollectionExampleUITests/StandaloneViewControllersTests/VideoPlayerViewControllerUITests.swift b/ContainerCollectionExampleUITests/StandaloneViewControllersTests/VideoPlayerViewControllerUITests.swift index 68c0959..045d13e 100644 --- a/ContainerCollectionExampleUITests/StandaloneViewControllersTests/VideoPlayerViewControllerUITests.swift +++ b/ContainerCollectionExampleUITests/StandaloneViewControllersTests/VideoPlayerViewControllerUITests.swift @@ -62,9 +62,8 @@ class VideoPlayerViewControllerUITests: BaseUITestCase { tapElement(identifier: Constant.VideoPlayer.fullScreenButton, type: .button, within: application) validateExistence(identifier: Constant.VideoPlayer.closeFullScreenButton, type: .button, within: application) validateExistence(identifier: Constant.VideoPlayer.sizeToFillButton, type: .button, within: application) - XCTAssertFalse(application.buttons[Constant.backButton].isHittable) + validateNonExistence(identifier: Constant.backButton, type: .button, within: application) tapElement(identifier: Constant.VideoPlayer.closeFullScreenButton, type: .button, within: application) - validateExistence(identifier: Constant.VideoPlayer.fullScreenButton, type: .button, within: application) validateNonExistence(identifier: Constant.VideoPlayer.closeFullScreenButton, type: .button, within: application) validateNonExistence(identifier: Constant.VideoPlayer.sizeToFillButton, type: .button, within: application) XCTAssertTrue(application.buttons[Constant.backButton].isHittable) diff --git a/Gemfile b/Gemfile index 5ab44b9..8552563 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -gem 'fastlane', '~>2.130.0' -gem 'cocoapods', '~>1.7.0' +gem 'fastlane', '~>2.141.0' +gem 'cocoapods', '~>1.8.0' diff --git a/Gemfile.lock b/Gemfile.lock index 3ad74b9..c1c131b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.1) + CFPropertyList (3.0.2) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) @@ -9,19 +9,22 @@ GEM tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.1) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) atomos (0.1.3) - babosa (1.0.2) + babosa (1.0.3) claide (1.0.3) - cocoapods (1.7.5) + cocoapods (1.8.4) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.7.5) + cocoapods-core (= 1.8.4) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.1, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -30,18 +33,20 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.10.0, < 2.0) - cocoapods-core (1.7.5) + xcodeproj (>= 1.11.1, < 2.0) + cocoapods-core (1.8.4) activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.2.2) + cocoapods-downloader (1.3.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.0) + cocoapods-trunk (1.4.1) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) @@ -49,7 +54,7 @@ GEM colored2 (3.1.2) commander-fastlane (4.4.6) highline (~> 1.7.2) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.6) declarative (0.0.10) declarative-option (0.1.0) digest-crc (0.4.1) @@ -58,16 +63,16 @@ GEM dotenv (2.7.5) emoji_regex (1.0.1) escape (0.0.4) - excon (0.71.0) - faraday (0.15.4) + excon (0.72.0) + faraday (0.17.3) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) faraday_middleware (0.13.1) faraday (>= 0.7.4, < 1.0) - fastimage (2.1.5) - fastlane (2.130.0) + fastimage (2.1.7) + fastlane (2.141.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) babosa (>= 1.0.2, < 2.0.0) @@ -76,13 +81,13 @@ GEM commander-fastlane (>= 4.4.6, < 5.0.0) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 2.0) - excon (>= 0.45.0, < 1.0.0) - faraday (~> 0.9) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 0.17) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.9) + faraday_middleware (~> 0.13.1) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.21.2, < 0.24.0) + google-api-client (>= 0.29.2, < 0.37.0) google-cloud-storage (>= 1.15.0, < 2.0.0) highline (>= 1.7.2, < 2.0.0) json (< 3.0.0) @@ -92,7 +97,7 @@ GEM multipart-post (~> 2.0.0) plist (>= 3.1.0, < 4.0.0) public_suffix (~> 2.0.0) - rubyzip (>= 1.2.2, < 2.0.0) + rubyzip (>= 1.3.0, < 2.0.0) security (= 0.1.3) simctl (~> 1.6.3) slack-notifier (>= 2.0.0, < 3.0.0) @@ -101,52 +106,54 @@ GEM tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) - xcodeproj (>= 1.8.1, < 2.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-api-client (0.23.9) + google-api-client (0.36.4) addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.5, < 0.7.0) + googleauth (~> 0.9) httpclient (>= 2.8.1, < 3.0) - mime-types (~> 3.0) + mini_mime (~> 1.0) representable (~> 3.0) retriable (>= 2.0, < 4.0) - signet (~> 0.9) - google-cloud-core (1.3.1) + signet (~> 0.12) + google-cloud-core (1.5.0) google-cloud-env (~> 1.0) - google-cloud-env (1.2.1) + google-cloud-errors (~> 1.0) + google-cloud-env (1.3.0) faraday (~> 0.11) - google-cloud-storage (1.16.0) + google-cloud-errors (1.0.0) + google-cloud-storage (1.25.1) + addressable (~> 2.5) digest-crc (~> 0.4) - google-api-client (~> 0.23) + google-api-client (~> 0.33) google-cloud-core (~> 1.2) - googleauth (>= 0.6.2, < 0.10.0) - googleauth (0.6.7) + googleauth (~> 0.9) + mini_mime (~> 1.0) + googleauth (0.10.0) faraday (~> 0.12) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.7) + signet (~> 0.12) highline (1.7.10) http-cookie (1.0.3) domain_name (~> 0.5) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.2.0) + json (2.3.0) jwt (2.1.0) - memoist (0.16.0) - mime-types (3.2.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2019.0331) - mini_magick (4.9.5) - minitest (5.11.3) + memoist (0.16.2) + mini_magick (4.10.1) + mini_mime (1.0.2) + minitest (5.14.0) molinillo (0.6.6) - multi_json (1.13.1) + multi_json (1.14.1) multi_xml (0.6.0) multipart-post (2.0.0) nanaimo (0.2.6) @@ -165,12 +172,12 @@ GEM ruby-macho (1.4.0) rubyzip (1.3.0) security (0.1.3) - signet (0.11.0) + signet (0.12.0) addressable (~> 2.3) faraday (~> 0.9) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simctl (1.6.5) + simctl (1.6.8) CFPropertyList naturally slack-notifier (2.3.2) @@ -178,19 +185,19 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) - tty-cursor (0.7.0) - tty-screen (0.7.0) - tty-spinner (0.9.1) + tty-cursor (0.7.1) + tty-screen (0.7.1) + tty-spinner (0.9.3) tty-cursor (~> 0.7) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) unf_ext unf_ext (0.0.7.6) - unicode-display_width (1.6.0) + unicode-display_width (1.6.1) word_wrap (1.0.0) - xcodeproj (1.12.0) + xcodeproj (1.15.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -205,8 +212,8 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (~> 1.7.0) - fastlane (~> 2.130.0) + cocoapods (~> 1.8.0) + fastlane (~> 2.141.0) BUNDLED WITH - 2.0.2 + 2.1.4 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7ef2c98..959257a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -4,38 +4,64 @@ default_platform(:ios) #################################################################################################### #################################################################################################### +############### +# Build lanes # +############### + +desc "Builds the framework for the specified platform (either 'iOS' or 'tvOS')." +desc "This lane is to make sure that all platforms build correctly and there are no breaking changes. No tests are executed." +desc "Usage example: fastlane build_framework platform:'iOS'" +lane :build_framework do |options| + raise "Missing 'platform' parameter. Usage: fastlane build_framework platform:PLATFORM" unless options[:platform] + platform = options[:platform] + xcbuild( + scheme: "ContainerCollection-" + "#{platform}", + clean: true + ) +end + +desc "Builds the example app for the specified iOS version." +desc "This lane is to make sure that the example app builds correctly and that breaking API changes are detected before deployment." +desc "Usage example: fastlane build_example_app ios_version:'12.4'" +lane :build_example_app do |options| + raise "Missing 'ios_version' parameter. Usage: fastlane build_example_app ios_version:IOS_VERSION" unless options[:ios_version] + ios_version = options[:ios_version] + xcbuild( + scheme: "ContainerCollectionExample", + sdk: "iphonesimulator" + "#{ios_version}", + clean: true + ) +end + ############## # Test lanes # ############## -platform :ios do - desc "Builds and runs iOS UITests on the example app." - lane :run_uiTests do - scan( - scheme: "ContainerCollectionExample", - device: "iPhone 6s", - xcargs: "-UseNewBuildSystem=YES", - clean: true, - disable_concurrent_testing: true - ) - end +desc "Builds and runs iOS UITests on the example app in the specified device." +desc "Usage example: fastlane run_uiTests device:'iPhone 8'" +lane :run_uiTests do |options| + raise "Missing 'device' parameter. Usage: fastlane ios test device:DEVICE" unless options[:device] + scan( + scheme: "ContainerCollectionExample", + device: options[:device], + clean: true, + disable_concurrent_testing: true + ) end #################################################################################################### #################################################################################################### -################# -# Release lanes # -################# +################### +# Deployment lane # +################### -desc "Updates the podspec file to match the version of the Xcode project (iOS framework), and pushes to GitHub repository." -desc "Tags the current release in the GitHub repository." desc "Deploys the podspec file to Trunk" +desc "Usage example: fastlane deploy_pod" lane :deploy_pod do - version_number = get_version_number(target: "ContainerCollection-iOS", configuration: "Release").to_s - version_bump_podspec(path: "ContainerCollection.podspec", version_number: version_number) - git_commit(path: "ContainerCollection.podspec", message: "Bump version to #{version_number}") - add_git_tag(tag: version_number) - push_to_git_remote(remote_branch: "master", tags: true) - pod_push(path: "ContainerCollection.podspec") + pod_push( + path: "ContainerCollection.podspec", + verbose: false, + swift_version: "5.0" + ) end \ No newline at end of file diff --git a/fastlane/README.md b/fastlane/README.md index 3a68a85..ccc7ea6 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -15,24 +15,38 @@ Install _fastlane_ using or alternatively using `brew cask install fastlane` # Available Actions -### deploy_pod +### build_framework ``` -fastlane deploy_pod +fastlane build_framework ``` -Updates the podspec file to match the version of the Xcode project (iOS framework), and pushes to GitHub repository. +Builds the framework for the specified platform (either 'iOS' or 'tvOS'). -Tags the current release in the GitHub repository. +This lane is to make sure that all platforms build correctly and there are no breaking changes. No tests are executed. -Deploys the podspec file to Trunk +Usage example: fastlane build_framework platform:'iOS' +### build_example_app +``` +fastlane build_example_app +``` +Builds the example app for the specified iOS version. ----- +This lane is to make sure that the example app builds correctly and that breaking API changes are detected before deployment. -## iOS -### ios run_uiTests +Usage example: fastlane build_example_app ios_version:'12.4' +### run_uiTests ``` -fastlane ios run_uiTests +fastlane run_uiTests ``` -Builds and runs iOS UITests on the example app. +Builds and runs iOS UITests on the example app in the specified device. + +Usage example: fastlane run_uiTests device:'iPhone 8' +### deploy_pod +``` +fastlane deploy_pod +``` +Deploys the podspec file to Trunk + +Usage example: fastlane deploy_pod ----