From e2c00599e5bac9a60f92098c679818006984f76b Mon Sep 17 00:00:00 2001 From: gentle-giraffe-apps Date: Thu, 22 Jan 2026 18:02:52 -0800 Subject: [PATCH 1/2] ci: speed up CI by reusing compiled artifacts between lanes --- Demo/SmartAsyncImageDemo/fastlane/Fastfile | 30 +++++++++++++++++---- Demo/SmartAsyncImageDemo/fastlane/README.md | 4 +-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Demo/SmartAsyncImageDemo/fastlane/Fastfile b/Demo/SmartAsyncImageDemo/fastlane/Fastfile index 5e4a64a..1e33805 100644 --- a/Demo/SmartAsyncImageDemo/fastlane/Fastfile +++ b/Demo/SmartAsyncImageDemo/fastlane/Fastfile @@ -15,20 +15,39 @@ default_platform(:ios) +# Shared derived data folder for faster incremental builds +DERIVED_DATA_PATH = File.expand_path("../../../.build/DerivedData", __dir__) + platform :ios do - desc "Build package and demo app" + desc "Build package and demo app (including tests with coverage)" lane :build do + # Build package tests first with coverage instrumentation + # This way the demo app build can reuse the compiled package + repo_root = File.expand_path("../../..", __dir__) + Dir.chdir(repo_root) do + sh <<~CMD + xcodebuild build-for-testing \ + -scheme SmartAsyncImage \ + -sdk iphonesimulator \ + -destination "generic/platform=iOS Simulator" \ + -derivedDataPath #{DERIVED_DATA_PATH} \ + -enableCodeCoverage YES + CMD + end + + # Build demo app (should reuse compiled package from above) build_app( project: "SmartAsyncImageDemo.xcodeproj", scheme: "SmartAsyncImageDemo", configuration: "Debug", - skip_package_ipa: true, # important: avoids IPA packaging - destination: "generic/platform=iOS Simulator" + skip_package_ipa: true, + destination: "generic/platform=iOS Simulator", + derived_data_path: DERIVED_DATA_PATH ) end - desc "Run package unit tests and gather coverage" + desc "Run package unit tests (no recompilation)" lane :package_tests do repo_root = File.expand_path("../../..", __dir__) @@ -38,10 +57,11 @@ platform :ios do rm -rf TestResults.xcresult coverage xccov.json coverage.xml mkdir -p coverage - xcodebuild test \ + xcodebuild test-without-building \ -scheme SmartAsyncImage \ -sdk iphonesimulator \ -destination "platform=iOS Simulator,name=iPhone 17" \ + -derivedDataPath #{DERIVED_DATA_PATH} \ -enableCodeCoverage YES \ -resultBundlePath TestResults.xcresult CMD diff --git a/Demo/SmartAsyncImageDemo/fastlane/README.md b/Demo/SmartAsyncImageDemo/fastlane/README.md index 8556530..f778e0d 100644 --- a/Demo/SmartAsyncImageDemo/fastlane/README.md +++ b/Demo/SmartAsyncImageDemo/fastlane/README.md @@ -21,7 +21,7 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do [bundle exec] fastlane ios build ``` -Build package and demo app +Build package and demo app (including tests with coverage) ### ios package_tests @@ -29,7 +29,7 @@ Build package and demo app [bundle exec] fastlane ios package_tests ``` -Run package unit tests and gather coverage +Run package unit tests (no recompilation) ### ios coverage_xml From 901d0a730dc952fa518fdcdea4441eeb021d72a3 Mon Sep 17 00:00:00 2001 From: gentle-giraffe-apps Date: Thu, 22 Jan 2026 18:04:34 -0800 Subject: [PATCH 2/2] update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index dbbeddc..d365a46 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ bazel-* # Coverage file coverage.xml +# Xcode test results +*.xcresult + # Fastlane artifacts (anywhere in repo) **/fastlane/report.xml **/fastlane/Preview.html