Skip to content
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
platform: ${{ matrix.platform }}
action: build # default = `test`
code-coverage: true # default = `false`
test-timeouts: 120 # optional; seconds; enables test timeouts
parallel-testing: true # optional; forwards -parallel-testing-enabled YES/NO
warnings-as-errors: true # default = `false`
configuration: release # no default, ie. `xcodebuild` decides itself
```
Expand Down
12 changes: 12 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ inputs:
This may be a security risk.
default: 'false'
required: false
test-timeouts:
description: |
Test execution time allowance in seconds. When set, we pass
`-default-test-execution-time-allowance <value>` and
`-test-timeouts-enabled YES` to xcodebuild for test actions.
(60 seconds is the minimum value.
required: false
parallel-testing:
description: |
When set, forwards `-parallel-testing-enabled <YES|NO>` to xcodebuild.
Use `true` to force enable parallel testing or `false` to disable it.
required: false
runs:
using: 'node20'
main: 'dist/index.js'
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ async function main() {
const action = getAction(selected, platform)
const configuration = getConfiguration()
const warningsAsErrors = core.getBooleanInput('warnings-as-errors')
const parallelTestingInput = core.getInput('parallel-testing')
const parallelTesting =
parallelTestingInput === ''
? undefined
: core.getBooleanInput('parallel-testing', { trimWhitespace: true })
const destination = await getDestination(selected, platform, platformVersion)
const identity = getIdentity(core.getInput('code-sign-identity'), platform)
const currentVerbosity = verbosity()
Expand Down Expand Up @@ -225,11 +230,28 @@ async function main() {
if (warningsAsErrors) args.push(warningsAsErrorsFlags)
break
case 'test':
case 'build-for-testing':
case 'build-for-testing': {
if (core.getBooleanInput('code-coverage')) {
args = args.concat(['-enableCodeCoverage', 'YES'])
}
// Optional test timeouts support
const testTimeouts = core.getInput('test-timeouts')
if (testTimeouts) {
args = args.concat([
'-default-test-execution-time-allowance',
testTimeouts,
'-test-timeouts-enabled',
'YES',
])
}
if (parallelTesting !== undefined) {
args = args.concat([
'-parallel-testing-enabled',
parallelTesting ? 'YES' : 'NO',
])
}
break
}
}

if (core.getBooleanInput('trust-plugins')) {
Expand Down
Loading