Skip to content

Commit

Permalink
carthage_installation_tests: optimize SPM package loading (#3129)
Browse files Browse the repository at this point in the history
Follow up to #3119. This job also needed the workaround to make sure
`Carthage` doesn't time out.

Also moved the implementation to Fastlane.
  • Loading branch information
NachoSoto authored Sep 1, 2023
1 parent 69fd1e6 commit 102cbe7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
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

Dir.chdir("..") do
# 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

0 comments on commit 102cbe7

Please sign in to comment.