Skip to content

Commit

Permalink
Setup SPM caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmya committed Jul 17, 2023
1 parent ada3522 commit 18bbfbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Build
on: push
on: [push, workflow_dispatch]

jobs:
build:
runs-on: macos-latest
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' }}
6 changes: 6 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 18bbfbd

Please sign in to comment.