Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/fastlane-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
- uses: actions/checkout@v5
- name: Use sample configuration
run: cp BeeKit/Config.swift.sample BeeKit/Config.swift
- uses: actions/cache@v4
with:
path: /Users/runner/work/BeeSwift/BeeSwift/DerivedData/SourcePackages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/actions/cache/blob/main/examples.md#swift---swift-package-manager

Shows how to use it for typical setups:

- uses: actions/cache@v4
  with:
    path: .build
    key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
    restore-keys: |
      ${{ runner.os }}-spm-

Copy link
Collaborator Author

@theospears theospears Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/68081067/spm-cache-not-working-on-github-actions-any-ideas suggests that is true if you are using swift package directly, but not if the resolution is being done by xcodebuild, as is being done here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK so we specify cloned_source_packages_path in scan/run_tests and replace path: .build with the path specified in run_tests' cloned_source_packages_path parameter.

https://itnext.io/effective-swift-package-manager-caching-with-fastlane-and-github-actions-b241585f0a4c

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looks like specifying derived_data_path also works. Do you have strong opinions on which is better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lean toward the cloned source option rather than the entire derived data. It seems more precisely targeted to what we want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it seems CI does not take long at all to grab the spm managed packages currently.

11:55:31
11:54:58

🤞 the direct cache would be faster. It probably would be more efficient in any case.

key: ${{ runner.os }}-spm2-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm2-
- name: Setup ruby and install gems
uses: ruby/setup-ruby@v1
with:
Expand Down
1 change: 1 addition & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ platform :ios do
buildlog_path: "fastlane/test_output",
xcodebuild_formatter: "xcpretty",
ensure_devices_found: true,
derived_data_path: "DerivedData",
)
end
lane :build do
Expand Down