If you develop a bunch swift packages it may be tricky to keep CI clean and updated for all of them, but a dedicated action can reduce code duplication and simplify CI support. This repository was inspired by CI setup of The Composable Architecture.
You can include the action in your workflow to trigger on any event that GitHub actions supports.
The with
portion of the workflow must be configured for the action.
Command for the action, basically it's the name of MAKE
workflow. For additional details check out Makefile
Type: required
Supported values:
xcodebuild
xcodebuild-raw
build-for-library-evolution
test-docs
- [
unchecked
,experimental
] for @2.0, please submit an issue if you face any
- [
benchmark
- [
unchecked
,experimental
] for @2.0, please submit an issue if you face any
- [
github-build-docs
- [
unchecked
,experimental
] for @2.0, please submit an issue if you face any
- [
swift-format
- [
unchecked
] for @2.0, but should work fine - Requires GitHub Secrets to be set up for committing changes
- Uses swift-format
- Commits changes to
main
branch, this behavior is not configurable, at least yet - Commit message is
[swift-format]
and is not configurable, at least yet
- [
Note
Commands with unchecked
and experimental
tags is in todo for verification. These flags mean that at some point these commands were used locally, but their use on CI was not validated. Currently we're in the process of migrating our repos to this action, but not every package uses these commands, however any potential issues for those commands should be fixed soon.
Subcommand for the action, basically only used as argument for xcodebuild
/xcodebuild-raw
commands
Type: optional
Default value: ''
Supported values:
''
test
- any other xcodebuild argument
Xcode version
Type: optional
Default value: 16.2
Argument that specifies if action should cache DerivedData
Type: optional
Default value: false
Supported values:
false
true
Path to xcworkspace. It is recommended to create a workspace at the root of the package and ensure that all required schemes are present.
Type: optional
Default value: .swiftpm/xcode/package.xcworkspace
Scheme/PackageTarget for the action.
<package-name>-package
usually suits for building and for testing
Type:
required
optional
forswift-format
command
Target platform for the action
Type:
optional
required
for the following commandsxcodebuild
xcodebuild-raw
test-docs
Supported values:
iOS
macOS
macCatalyst
watchOS
tvOS
visionOS
Build configuration for the action.
Type: optional
Default value: Debug
Specifies if xcodebuild output should be beautified. Uses xcbeautify
Type: optional
Default value: quiet
Supported values:
quiet
true
false
Relative path to target directory
Type: optional
Default value: '.'
- name: Test CoolStuff
uses: capturecontext/[email protected]
with:
xcode: 16.2
workspace: 'Package.xcworkspace' # custom workspace at the root of a repo
cache-derived-data: true
command: xcodebuild
subcommand: test
scheme: cool-stuff-package # likely to be a name of the package
platform: iOS
config: Debug
beautify: true
working-directory: '.'
- name: Test CoolStuff
uses: capturecontext/[email protected]
with:
workspace: 'Package.xcworkspace'
cache-derived-data: true
command: xcodebuild
subcommand: test
scheme: cool-stuff-package
platform: iOS
swift-existential-container
swift-composable-architecture
This action is released under the MIT license. See LICENSE for details.
See ACKNOWLEDGEMENTS.md for inspiration references and their licences.