From 5286164d230930aebf53fe16af09c5001a406a2e Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 20 Apr 2021 16:10:37 +0200 Subject: [PATCH] Fastlane: Add a lane for tests --- fastlane/Fastfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2c5373ac4..6bc195e93 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -79,6 +79,33 @@ platform :ios do ) end + desc "Run tests" + lane :test do + xcodegen(spec: "project.yml") + cocoapods + + opts = { + :clean => true, + :scheme => "Riot", + :workspace => "Riot.xcworkspace", + :configuration => "Debug", + :code_coverage => true, + # Test result configuration + :result_bundle => true, + :output_directory => "./build/test", + :open_report => !is_ci? + } + begin + scan(opts) + ensure + Dir.chdir("../#{opts[:output_directory]}") do + xcresult = "#{opts[:scheme]}.xcresult" + sh("zip", "-r", "#{xcresult}.zip", xcresult) + end + end + end + + #### Private #### desc "Download App Store or Ad-Hoc provisioning profiles"