From 18bbfbd621d9787d8c53d96643e9533e26805e20 Mon Sep 17 00:00:00 2001 From: Jimmy Arts Date: Mon, 17 Jul 2023 20:25:23 +0200 Subject: [PATCH] Setup SPM caching --- .github/workflows/build.yml | 12 +++++++++++- fastlane/Fastfile | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 020d399..05a5446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: Build -on: push +on: [push, workflow_dispatch] jobs: build: @@ -7,5 +7,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Cache packages + uses: actions/cache@v3 + id: packages-cache + with: + path: packages_cache + key: ${{ runner.os }}-packages-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-packages- - name: Build run: fastlane build + env: + HAS_PACKAGES_CACHE_HIT: ${{ steps.packages-cache.outputs.cache-hit == 'true' }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b13fc85..633271b 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -15,12 +15,18 @@ default_platform(:ios) +ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "180" + platform :ios do desc "Build" lane :build do + packages_path = "#{File.expand_path("..", Dir.pwd)}/packages_cache" scan( build_for_testing: true, scheme: "Example", + cloned_source_packages_path: packages_path, + disable_package_automatic_updates: true, + skip_package_dependencies_resolution: ENV["HAS_PACKAGES_CACHE_HIT"], ) end end