-
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the setup-swift wiki! Your one stop for frequent questions and details about this action.
This action uses swift.org repo to get toolchains version data to compare with user provided version inputs. Specific commit id stored in GitHub pages metadata is used for fetching swift.org repo. This commit id can be overridden with providing custom commit hash, branch name, tag or any other git ref in the check-latest
option, or just providing true
will fetch the latest commit in default branch.
The GitHub pages metadata is updated if new changes published in swift.org repo that don't break this action, the CI of this action takes care of this update and testing if any breaking changes automatically.
This action parses the content of swift.org repo for latest toolchains, which allows no manual interference to add support for newly published toolchains as long as there is no breaking change.
The limitation with having only this approach is as soon as a braking change introduced in swift.org repo toolchain format, this action would have broken. Hence this action keeps a specific snapshot of swift.org repo that is tested exhaustively with the CI of this action and used for parsing toolchains data. This snapshot is also updated daily after passing all the requirements.
check-latest
flag allows you to circumvent this, if set as true
this action takes the latest snapshot instead of using the pre-saved snapshot, or providing specific git ref in this option will use that specific ref instead of the pre-saved snapshot. For example, if the swift.org snapshot this action uses has Swift 5.9.2 as the stable toolchain, and latest toolchain available in swift.org is Swift 5.10, with check-latest
enabled the latest published Swift 5.10 in swift.org can be installed by this action.
Caution
Enabling check-latest
comes at a cost of breaking actions if there is a breaking change in swift.org.
-
This action fetches a specific commit of swift.org repo as part of the run, all the files in this repo are downloaded, regardless whether they are used to check suitable toolchain version to download. While this approach provides flexibility for user to install desired toolchain, this does introduce around 5s delay in action run.
-
This action also verifies downloaded toolchains on all the platforms (
gpg
used forLinux
andWindows
,pkgutil
formacOS
), which introduces delay of around 5-10s delay in action run. -
This action also caches installation directory which can be reused in subsequent action run without going through the installation process again. While this speeds up installation in subsequent runs, this does slow down first action run for a particular toolchain version by around 30s(Linux)-1m(macOS) depending on the runner OS. This caching also subject to usage limit imposed by GitHub and can be disabled by setting
cache-snapshot
tofalse
.
Tip
Run this action on your default branch first, so that cache generated by default branch can be reused by other branches.
Any contribution on performance optimization is welcome here!
This action only stores swift.org repo latest supported commit hash metadata in GitHub pages metadata.json file. There is no other usage of GitHub pages by this action, no static site is hosted in GitHub pages.