From 073132babb92449750e3bfa7c59fe359669035da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Caetano?= Date: Tue, 31 Oct 2017 19:00:30 -0200 Subject: [PATCH] - Fix: Podfile fork path - Fix: pod repo update before linting - Fastlane action for Codecov upload --- .gitmodules | 3 +++ Example/Podfile | 2 +- Example/Podfile.lock | 8 ++++---- fastlane/Fastfile | 29 +++++++++++++++++++++++++++-- fastlane/actions | 1 + 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 .gitmodules create mode 160000 fastlane/actions diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cd39db7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "fastlane/actions"] + path = fastlane/actions + url = https://gist.github.com/04126b3051f6cd6aebe041bb1dfe14e9.git diff --git a/Example/Podfile b/Example/Podfile index f897fe0..b556f1f 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -13,7 +13,7 @@ target 'ReCaptcha_Example' do target 'ReCaptcha_Tests' do inherit! :search_paths - pod 'AppSwizzle', :git => 'git@github.com:fjcaetano/AppSwizzle.git', :branch => 'swift4' + pod 'AppSwizzle', :git => 'https://github.com/fjcaetano/AppSwizzle.git', :branch => 'swift4' end end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index a725868..008ebff 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -12,7 +12,7 @@ PODS: - SwiftLint (0.23.1) DEPENDENCIES: - - AppSwizzle (from `git@github.com:fjcaetano/AppSwizzle.git`, branch `swift4`) + - AppSwizzle (from `https://github.com/fjcaetano/AppSwizzle.git`, branch `swift4`) - ReCaptcha/RxSwift (from `../`) - RxCocoa (~> 4.0) - SwiftLint (~> 0.23) @@ -20,14 +20,14 @@ DEPENDENCIES: EXTERNAL SOURCES: AppSwizzle: :branch: swift4 - :git: git@github.com:fjcaetano/AppSwizzle.git + :git: https://github.com/fjcaetano/AppSwizzle.git ReCaptcha: :path: ../ CHECKOUT OPTIONS: AppSwizzle: :commit: c432a73e43779d20ef8e8a589aabd9622b7b6a5d - :git: git@github.com:fjcaetano/AppSwizzle.git + :git: https://github.com/fjcaetano/AppSwizzle.git SPEC CHECKSUMS: AppSwizzle: bbd3782652fc426ce59c045a92ec61d36f261984 @@ -37,6 +37,6 @@ SPEC CHECKSUMS: RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334 SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa -PODFILE CHECKSUM: b22c55655f09e6f7d188835d6914c58236e5956e +PODFILE CHECKSUM: de2b642fc95f65632e92b6b5beba95353f716393 COCOAPODS: 1.3.1 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index dcf566a..282452f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,6 +18,9 @@ default_platform :ios platform :ios do skip_docs + lane :cov do + end + desc "Runs all the tests" lane :test do cocoapods( @@ -29,17 +32,34 @@ platform :ios do strict: true ) + # The problem lies in the fact (or rather: serious bug in xcodebuild) that + # the timeout for connecting to the XCTest server starts at the moment you + # issue the command xcodebuild. The timeout is 120 seconds, so if your + # compilation + startup of the simulator takes longer than 2 minutes + # xcodebuild will give this "Canceling tests due to timeout" error. + # https://stackoverflow.com/questions/37922146/xctests-failing-on-physical-device-canceling-tests-due-to-timeout/40790171#40790171 scan( workspace: "Example/ReCaptcha.xcworkspace", scheme: "ReCaptcha-Example", device: ENV["DEVICE"], - # device: "iPhone X (11.0)", code_coverage: true, + build_for_testing: true + ) + + scan( + workspace: "Example/ReCaptcha.xcworkspace", + scheme: "ReCaptcha-Example", + device: ENV["DEVICE"], + code_coverage: true, + test_without_building: true ) if is_ci puts "Uploading coverage files to CodeCov" - sh "curl -s https://codecov.io/bash | bash -s -- -J 'ReCaptcha'" + codecov( + project_name: 'ReCaptcha', + use_xcodeplist: true, + ) else puts "Not CI: Skipping coverage files upload" end @@ -47,6 +67,11 @@ platform :ios do desc "Lint Cocoapods Lib" lane :pod_lint do + cocoapods( + podfile: "Example/Podfile", + repo_update: true + ) + pod_lib_lint( allow_warnings: true # Remove this when RxSwift stops warning ) diff --git a/fastlane/actions b/fastlane/actions new file mode 160000 index 0000000..75911fa --- /dev/null +++ b/fastlane/actions @@ -0,0 +1 @@ +Subproject commit 75911fa21bda7824d7fe638eb3ff0f5d5f8ffe9a