Created
May 15, 2023 13:31
-
-
Save Lutzifer/359b970cf9809554bb4dec1f1fa71bdb to your computer and use it in GitHub Desktop.
Fastlane Lane to run tests on spm packages
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
desc "Run Package Tests" | |
lane :package_tests do | |
Dir.chdir("..") do | |
# iterate over packages folder | |
Dir.glob("packages/*").each do |package| | |
Dir.chdir(package) do | |
UI.message("Running tests for #{package}") | |
begin | |
%x(xcodebuild -list -quiet -json 2>/dev/null | jq -r '.workspace.schemes[]').split("\n").each do |scheme| | |
# Use Mac Catalyst to speed up running by an order of magnitude | |
sh %Q(xcodebuild -scheme #{scheme} test -destination 'platform=macOS,variant=Mac Catalyst') | |
end | |
UI.success("Tests for #{package} passed") | |
rescue | |
UI.error("Tests for #{package} failed") | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment