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

Allow to specify Swift version with xcodebuild #57

Merged
merged 4 commits into from
Jul 11, 2024
Merged
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
17 changes: 14 additions & 3 deletions .github/workflows/xcodebuild-or-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ on:
type: string
default: 'platform=iOS Simulator,name=iPhone 15 Pro'
setupSimulators:
description: 'Flag indicating if all iOS simulators matching the `destination` input shoud be setup (e.g. password autofill functionality should be disabled).'
description: 'Flag indicating if all iOS simulators matching the `destination` input should be setup (e.g. password autofill functionality should be disabled).'
required: false
type: boolean
default: false
Expand All @@ -51,8 +51,13 @@ on:
required: false
type: string
default: ''
swiftVersion:
description: 'Specify the Swift language version when using xcodebuild.'
required: false
type: string
default: ''
test:
description: 'A flag indicating if the tests of the Xcode project scheme should run'
description: 'A flag indicating if the tests of the Xcode project scheme should run when using xcodebuild.'
required: false
type: boolean
default: true
Expand Down Expand Up @@ -366,6 +371,12 @@ jobs:
else
ENABLE_TESTING_FLAG=""
fi

if [ -n "${{ inputs.swiftVersion }}" ]; then
SWIFT_VERSION_FLAG="-swift-version ${{ inputs.swiftVersion }}"
else
SWIFT_VERSION_FLAG=""
fi

set -o pipefail \
&& xcodebuild $XCODECOMMAND \
Expand All @@ -377,7 +388,7 @@ jobs:
-resultBundlePath "$RESULTBUNDLE" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY="" \
OTHER_SWIFT_FLAGS="\$(inherited) $ENABLE_TESTING_FLAG" \
OTHER_SWIFT_FLAGS="\$(inherited) $ENABLE_TESTING_FLAG $SWIFT_VERSION_FLAG" \
-skipPackagePluginValidation \
-skipMacroValidation \
| xcbeautify
Expand Down
Loading