Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carthage_installation_tests: optimize SPM package loading #3129

Merged
merged 1 commit into from
Sep 1, 2023
Merged
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: 1 addition & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,8 @@ jobs:
- run:
name: Carthage Update
working_directory: Tests/InstallationTests/CarthageInstallation/
# install without building, then remove the tests and build, so that carthage
# doesn't try to build the other installation tests
command: |
carthage update --no-build
rm -rf Carthage/Checkouts/purchases-root/Tests/InstallationTests/
carthage build --use-xcframeworks --verbose
bundle exec fastlane installation_tests

- install-dependencies-scan-and-archive:
directory: Tests/InstallationTests/CarthageInstallation/
Expand Down
12 changes: 12 additions & 0 deletions Tests/InstallationTests/CarthageInstallation/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ desc "Update carthage commit"
backup_extension = '.bck'
sh("sed", '-i', backup_extension, sed_regex, '../Cartfile')
end

lane :installation_tests do
load_spm_dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the core change, adding this which was introduced in #3119.


Dir.chdir("..") do
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also use "#{File.dirname(__FILE__)}/../? I guess the circleci job already has the working_directory set, so it would probably work without this, but thinking in case we want to run this locally for any reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you run it locally you'd have to run it from Tests/InstallationTests/CarthageInstallation and then doing fastlane installation_tests. So I think it's fine to leave this as an implicitly relative path.

# install without building, then remove the tests and build, so that carthage
# doesn't try to build the other installation tests
sh "carthage", "update", "--no-build"
sh "rm", "-rf", "Carthage/Checkouts/purchases-root/Tests/InstallationTests/"
sh "carthage", "build", "--use-xcframeworks", "--verbose"
end
end
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ lane :load_spm_dependencies do
# This preemptively runs this command to make sure the SPM dependencies are fetched
# without a timeout.

Dir.chdir("..") do
Dir.chdir("#{File.dirname(__FILE__)}/../") do
sh("xcodebuild", "-list")
end
end
Expand Down
8 changes: 8 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do



### load_spm_dependencies

```sh
[bundle exec] fastlane load_spm_dependencies
```



----


Expand Down