-
-
Save laevandus/5e4b6d433c9e2fec4fcd1de120e14cbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
default_platform(:ios) | |
platform :ios do | |
desc "Run tests and create a unit-test report" | |
lane :test_report do | |
spm( | |
command: 'generate-xcodeproj', | |
enable_code_coverage: true | |
) | |
run_tests( | |
project: 'SPMPackage.xcodeproj', | |
scheme: 'SPMPackage-Package', | |
device: 'iPhone 12', | |
output_directory: './fastlane/UnitTests', | |
clean: true | |
) | |
xcov( | |
project: 'SPMPackage.xcodeproj', | |
scheme: 'SPMPackage-Package', | |
output_directory: './fastlane/CodeCoverage', | |
include_targets: 'SPMPackage.framework', | |
minimum_coverage_percentage: 80.0 | |
) | |
if ENV['CI'] != 'true' | |
sh 'open ./UnitTests/report.html' | |
sh 'open ./CodeCoverage/index.html' | |
end | |
end | |
before_all do | |
FileUtils.remove_dir './CodeCoverage', true | |
FileUtils.remove_dir './UnitTests', true | |
end | |
after_all do | |
FileUtils.remove_dir './../SPMPackage.xcodeproj', true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment