Skip to content

Commit 0a4ffd8

Browse files
committed
Add test-timeouts optional parameter
1 parent 96d9ef9 commit 0a4ffd8

5 files changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
platform: ${{ matrix.platform }}
6666
action: build # default = `test`
6767
code-coverage: true # default = `false`
68+
test-timeouts: 120 # optional; seconds; enables test timeouts
6869
warnings-as-errors: true # default = `false`
6970
configuration: release # no default, ie. `xcodebuild` decides itself
7071
```

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ inputs:
135135
This may be a security risk.
136136
default: 'false'
137137
required: false
138+
test-timeouts:
139+
description: |
140+
Test execution time allowance in seconds. When set, we pass
141+
`-default-test-execution-time-allowance <value>` and
142+
`-test-timeouts-enabled=YES` to xcodebuild for test actions.
143+
(60 seconds is the minimum value.
144+
required: false
138145
runs:
139146
using: 'node20'
140147
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,21 @@ async function main() {
225225
if (warningsAsErrors) args.push(warningsAsErrorsFlags)
226226
break
227227
case 'test':
228-
case 'build-for-testing':
228+
case 'build-for-testing': {
229229
if (core.getBooleanInput('code-coverage')) {
230230
args = args.concat(['-enableCodeCoverage', 'YES'])
231231
}
232+
// Optional test timeouts support
233+
const testTimeouts = core.getInput('test-timeouts')
234+
if (testTimeouts) {
235+
args = args.concat([
236+
'-default-test-execution-time-allowance',
237+
testTimeouts,
238+
'-test-timeouts-enabled=YES',
239+
])
240+
}
232241
break
242+
}
233243
}
234244

235245
if (core.getBooleanInput('trust-plugins')) {

0 commit comments

Comments
 (0)