♻️ :: Refactor CI test setup

This commit is contained in:
Felix Mau
2022-09-19 13:20:31 +02:00
parent 8757179241
commit b6593371cd
3 changed files with 100 additions and 10 deletions
+8 -4
View File
@@ -50,11 +50,15 @@ jobs:
working-directory: ./Example
run: bundle exec fastlane lint
# - name: Execute tests.
# working-directory: ./Example
# run: bundle exec fastlane tests
- name: Execute tests.
working-directory: ./Example
run: bundle exec fastlane tests
- name: Execute validation of library (incl. running tests).
- name: Execute validation Carthage support.
working-directory: ./Example
run: bundle exec fastlane verify_carthage
- name: Execute validation of library.
working-directory: ./Example
run: bundle exec fastlane pod_lint
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A92A7C75080512A0168578180C192A2"
BuildableName = "GradientLoadingBar-Unit-Tests.xctest"
BlueprintName = "GradientLoadingBar-Unit-Tests"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1A92A7C75080512A0168578180C192A2"
BuildableName = "GradientLoadingBar-Unit-Tests.xctest"
BlueprintName = "GradientLoadingBar-Unit-Tests"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+24 -6
View File
@@ -35,24 +35,42 @@ platform :ios do
)
end
desc "Verify Carthage support by making sure the scheme `GradientLoadingBar` is shared."
lane :verify_carthage do
#
# For Carthage support we explicitly have to mark the scheme `GradientLoadingBar` as shared.
# Source: https://www.amerhukic.com/how-to-add-carthage-support-in-existing-cocoapod-project
#
build_app(
project: "Pods/Pods.xcodeproj",
scheme: "GradientLoadingBar",
skip_archive: true
)
end
desc "Execute tests."
lane :tests do
run_tests(
# Running `pod install` will add the scheme `GradientLoadingBar-Unit-Tests` as non shared.
# As a workaround we added the test target to the `Example` scheme.
workspace: "Example.xcworkspace",
project: "Pods/Pods.xcodeproj",
scheme: "GradientLoadingBar-Unit-Tests",
devices: ["iPhone 13"],
scheme: "Example"
code_coverage: true,
number_of_retries: 1
)
end
desc "Execute validation of library."
lane :pod_lint do
Dir.chdir("..") do
#
# Move outside of `Example/` directory.
#
# - Note: `pod lib lint` will also run the tests.
pod_lib_lint()
# - Note: We skip running the tests here, as we have a separate lane for this which allows better customization.
#
pod_lib_lint(
verbose: true,
skip_tests: true
)
end
end
end