diff --git a/.travis.yml b/.travis.yml index bcbcbc5..4eba5a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ osx_image: xcode9 language: objective-c +cache: + cocoapods: true + directories: + - Carthage + script: - bundle exec fastlane ci diff --git a/Example/ReCaptcha.xcodeproj/project.pbxproj b/Example/ReCaptcha.xcodeproj/project.pbxproj index 707d3c4..3fbcc13 100644 --- a/Example/ReCaptcha.xcodeproj/project.pbxproj +++ b/Example/ReCaptcha.xcodeproj/project.pbxproj @@ -214,7 +214,6 @@ 607FACCE1AFB9204008FA782 /* Resources */, 8F03FFB3F5C55E873C23C682 /* [CP] Embed Pods Frameworks */, ED1C0E07490C9C4B4A401061 /* [CP] Copy Pods Resources */, - F2C0FD7E1F9F8061009B7A6F /* SwiftLint */, ); buildRules = ( ); @@ -419,20 +418,6 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReCaptcha_Example/Pods-ReCaptcha_Example-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F2C0FD7E1F9F8061009B7A6F /* SwiftLint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = SwiftLint; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ -f \"${PODS_ROOT}/SwiftLint/swiftlint\" ]; then\n \"${PODS_ROOT}/SwiftLint/swiftlint\" --path \"${PROJECT_DIR}/..\"\nelse\n echo \"error: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\n exit 1\nfi"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/codecov.yml b/codecov.yml index ab66290..2c11920 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,7 +4,7 @@ codecov: coverage: precision: 2 round: down - range: "90...100" + range: "75...95" status: project: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f0f5bc8..616e4c3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -10,12 +10,10 @@ default_platform :ios platform :ios do skip_docs - devices = [ - "iPhone X (11.0)", - "iPhone 7 (10.0)", - "iPhone 6 (9.0)", - "iPhone 5s (8.1)", - ] + devices = ["iPhone X (11.0)"] + devices << "iPhone 7 (10.0)" if !Helper.is_ci? + devices << "iPhone 6 (9.0)" if !Helper.is_ci? + devices << "iPhone 5s (8.1)" if !Helper.is_ci? desc "Runs the following lanes:\n- test\n- pod_lint\n- carthage_lint" lane :ci do @@ -26,11 +24,6 @@ platform :ios do desc "Runs all the tests" lane :test do - ios_simulator( - devices: devices, - reset_before_launching: is_ci, - ) - cocoapods( podfile: "Example/Podfile", ) @@ -52,8 +45,6 @@ platform :ios do scheme: "ReCaptcha-Example", workspace: "Example/ReCaptcha.xcworkspace", code_coverage: true, - buildlog_path: File.join(ENV['BITRISE_DEPLOY_DIR'] || '.', "logs/build"), - xcargs: '-maximum-concurrent-test-device-destinations=1', ) scan( @@ -62,12 +53,9 @@ platform :ios do scheme: "ReCaptcha-Example", workspace: "Example/ReCaptcha.xcworkspace", code_coverage: true, - buildlog_path: File.join(ENV['BITRISE_DEPLOY_DIR'] || '.', "logs/run"), - xcargs: '-maximum-concurrent-test-device-destinations=1', ) if is_ci - puts "Uploading coverage files to CodeCov" codecov( project_name: 'ReCaptcha', use_xcodeplist: true, @@ -100,8 +88,6 @@ platform :ios do desc "Deploy a new version to Github and Cocoapods" lane :release do - ci unless is_ci - carthage( command: "archive", ) diff --git a/fastlane/actions/ios_simulator.rb b/fastlane/actions/ios_simulator.rb deleted file mode 100644 index 9e451ce..0000000 --- a/fastlane/actions/ios_simulator.rb +++ /dev/null @@ -1,78 +0,0 @@ -module Fastlane - module Actions - module SharedValues - IOS_SIMULATOR_CUSTOM_VALUE = :IOS_SIMULATOR_CUSTOM_VALUE - end - - class IosSimulatorAction < Action - @@already_booted_code = 164 - - def self.run(params) - devices = params[:devices] || Array(params[:device]) - available_sims = FastlaneCore::Simulator.all - - devices.each do |device| - sim = available_sims.detect { |d| device == "#{d.name} (#{d.os_version})" } - if sim.nil? - UI.error "Device not found: #{device}" - next - end - - if params[:reset_before_launching] - sim.reset - end - - `xcrun simctl boot #{sim.udid} > /dev/null 2>&1` - if $?.exitstatus == @@already_booted_code - UI.important "Skipping #{device} (already booted)" - end - - UI.message "Booted #{device} [#{sim.udid}]" unless $?.exitstatus == @@already_booted_code - end - end - - ##################################################### - # @!group Documentation - ##################################################### - - def self.description - "Launch iOS simulators beforehand to allow for boot time" - end - - def self.details - "Run `xcrun instruments -s` for the list of available simulators" - end - - def self.available_options - [ - FastlaneCore::ConfigItem.new(key: :device, - env_name: "SCAN_DEVICE", - description: "The name of the simulator type you want to run tests on (e.g. 'iPhone 6 (10.0)')", # a short description of this parameter - conflicting_options: [:devices], - ), - FastlaneCore::ConfigItem.new(key: :devices, - env_name: "SCAN_DEVICES", - description: "Array of devices to run the tests on (e.g. ['iPhone 6 (10.0)', 'iPad Air (8.3)'])", - is_string: false, - conflicting_options: [:device], - optional: true, - ), - FastlaneCore::ConfigItem.new(key: :reset_before_launching, - env_name: "FL_IOS_SIMULATOR_RESET", - description: "Should reset simulators before launching", - is_string: false, - default_value: false, - ), - ] - end - - def self.author - "Flávio Caetano (@fjcaetano)" - end - - def self.is_supported?(platform) - platform == :ios - end - end - end -end