Skip to content

Commit 7650d81

Browse files
authored
Make build timeouts configurable (#228)
1 parent 6eb4e98 commit 7650d81

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/swift_package_test.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ on:
123123
type: string
124124
description: "macOS command to build and test the package"
125125
default: "xcrun swift test"
126+
macos_build_timeout:
127+
type: number
128+
description: "The default step timeout in minutes"
129+
default: 60
126130
ios_pre_build_command:
127131
type: string
128132
description: "macOS command to execute before building the Swift package for iOS"
@@ -131,6 +135,10 @@ on:
131135
type: string
132136
description: "macOS command to build the package for iOS"
133137
default: "xcrun swift build --build-tests --sdk \"$(xcrun --sdk iphoneos --show-sdk-path)\" --triple arm64-apple-ios"
138+
ios_build_timeout:
139+
type: number
140+
description: "The default step timeout in minutes"
141+
default: 60
134142
linux_build_command:
135143
type: string
136144
description: "Linux command to build and test the package"
@@ -166,6 +174,10 @@ on:
166174
Note that Powershell does not automatically exit if a subcommand fails. The Invoke-Program utility is available to propagate non-zero exit codes.
167175
It is strongly encouraged to run all command using `Invoke-Program` unless you want to continue on error eg. `Invoke-Program git apply patch.diff` instead of `git apply patch.diff`.
168176
default: "Invoke-Program swift test"
177+
windows_build_timeout:
178+
type: number
179+
description: "The default step timeout in minutes"
180+
default: 60
169181
macos_env_vars:
170182
description: "Newline separated list of environment variables"
171183
type: string
@@ -266,7 +278,7 @@ jobs:
266278
run: ${{ inputs.macos_pre_build_command }}
267279
- name: Build / Test
268280
run: ${{ inputs.macos_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
269-
timeout-minutes: 60
281+
timeout-minutes: ${{ inputs.macos_build_timeout }}
270282

271283
ios-build:
272284
name: iOS (Build Only, Xcode ${{ matrix.xcode_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }})
@@ -304,7 +316,7 @@ jobs:
304316
run: ${{ inputs.ios_pre_build_command }}
305317
- name: Build
306318
run: ${{ inputs.ios_build_command }} ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
307-
timeout-minutes: 60
319+
timeout-minutes: ${{ inputs.ios_build_timeout }}
308320

309321
linux-build:
310322
name: Linux (${{ matrix.swift_version }} - ${{ matrix.os_version }} - ${{ matrix.arch }})
@@ -786,12 +798,12 @@ jobs:
786798
'@ >> $env:TEMP\test-script\run.ps1
787799
# Docker build
788800
- name: Docker Build / Test
789-
timeout-minutes: 60
801+
timeout-minutes: ${{ inputs.windows_build_timeout }}
790802
if: ${{ inputs.enable_windows_docker }}
791803
run: |
792804
docker run -v ${{ github.workspace }}:C:\source -v $env:TEMP\test-script:C:\test-script ${{ steps.pull_docker_image.outputs.image }} powershell.exe -NoLogo -File C:\test-script\run.ps1
793805
# Docker-less build
794806
- name: Build / Test
795-
timeout-minutes: 60
807+
timeout-minutes: ${{ inputs.windows_build_timeout }}
796808
if: ${{ !inputs.enable_windows_docker }}
797809
run: powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1; exit $LastExitCode

0 commit comments

Comments
 (0)