Skip to content

Commit 487edc0

Browse files
authoredApr 13, 2023
Add timeout input v2 (#19)
* Add timeout input * Fix typo
1 parent 096425c commit 487edc0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎.github/workflows/build.yml

+11
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ on:
119119
type: string
120120
description: 'Override the env.json file'
121121

122+
timeout_minutes:
123+
required: false
124+
type: number
125+
default: 10
126+
122127
secrets:
123128
VAULT_ADDR:
124129
required: false
@@ -141,6 +146,7 @@ jobs:
141146
setup:
142147
name: 'Environment setup'
143148
runs-on: ${{ inputs.runner }}
149+
timeout-minutes: ${{ inputs.timeout_minutes }}
144150
steps:
145151
- name: Git checkout
146152
uses: actions/checkout@v3
@@ -166,6 +172,7 @@ jobs:
166172
name: 'Build the application'
167173
if: ${{ contains(inputs.ci_steps, 'build') }}
168174
runs-on: ${{ inputs.runner }}
175+
timeout-minutes: ${{ inputs.timeout_minutes }}
169176
steps:
170177
- name: Git checkout
171178
uses: actions/checkout@v3
@@ -221,6 +228,7 @@ jobs:
221228
name: 'Lint the code'
222229
if: ${{ contains(inputs.ci_steps, 'lint') }}
223230
runs-on: ${{ inputs.runner }}
231+
timeout-minutes: ${{ inputs.timeout_minutes }}
224232
steps:
225233
- name: Git checkout
226234
uses: actions/checkout@v3
@@ -249,6 +257,7 @@ jobs:
249257
name: 'Run tests'
250258
if: ${{ contains(inputs.ci_steps, 'test') }}
251259
runs-on: ${{ inputs.runner }}
260+
timeout-minutes: ${{ inputs.timeout_minutes }}
252261
steps:
253262
- name: Git checkout
254263
uses: actions/checkout@v3
@@ -277,6 +286,7 @@ jobs:
277286
name: 'Run tests with coverage'
278287
if: ${{ contains(inputs.ci_steps, 'jest') }}
279288
runs-on: ${{ inputs.runner }}
289+
timeout-minutes: ${{ inputs.timeout_minutes }}
280290
steps:
281291
- name: Git checkout
282292
uses: actions/checkout@v3
@@ -308,6 +318,7 @@ jobs:
308318
name: 'Analyze the Next.js bundle size'
309319
if: ${{ contains(inputs.ci_steps, 'analyze') }}
310320
runs-on: ${{ inputs.runner }}
321+
timeout-minutes: ${{ inputs.timeout_minutes }}
311322
steps:
312323
- name: Git checkout
313324
uses: actions/checkout@v3

‎.github/workflows/pipeline.yml

+12
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ on:
115115
required: false
116116
type: string
117117

118+
timeout_minutes:
119+
required: false
120+
type: number
121+
default: 10
122+
118123
secrets:
119124
VAULT_ADDR:
120125
required: false
@@ -139,6 +144,7 @@ jobs:
139144
setup:
140145
name: 'Environment setup'
141146
runs-on: ${{ inputs.runner }}
147+
timeout-minutes: ${{ inputs.timeout_minutes }}
142148
steps:
143149
- name: Git checkout
144150
uses: actions/checkout@v3
@@ -164,6 +170,7 @@ jobs:
164170
name: 'Build'
165171
if: ${{ contains(inputs.ci_steps, 'build') || contains(inputs.ci_steps, 'analyze') }}
166172
runs-on: ${{ inputs.runner }}
173+
timeout-minutes: ${{ inputs.timeout_minutes }}
167174
steps:
168175
- name: Git checkout
169176
uses: actions/checkout@v3
@@ -206,6 +213,7 @@ jobs:
206213
name: 'Lint the code'
207214
if: ${{ contains(inputs.ci_steps, 'lint') }}
208215
runs-on: ${{ inputs.runner }}
216+
timeout-minutes: ${{ inputs.timeout_minutes }}
209217
steps:
210218
- name: Git checkout
211219
uses: actions/checkout@v3
@@ -234,6 +242,7 @@ jobs:
234242
name: 'Run tests'
235243
if: ${{ contains(inputs.ci_steps, 'test') }}
236244
runs-on: ${{ inputs.runner }}
245+
timeout-minutes: ${{ inputs.timeout_minutes }}
237246
steps:
238247
- name: Git checkout
239248
uses: actions/checkout@v3
@@ -262,6 +271,7 @@ jobs:
262271
name: 'Run tests with coverage'
263272
if: ${{ contains(inputs.ci_steps, 'jest') }}
264273
runs-on: ${{ inputs.runner }}
274+
timeout-minutes: ${{ inputs.timeout_minutes }}
265275
steps:
266276
- name: Git checkout
267277
uses: actions/checkout@v3
@@ -293,6 +303,7 @@ jobs:
293303
name: 'Analyze the Next.js bundle size'
294304
if: ${{ contains(inputs.ci_steps, 'analyze') }}
295305
runs-on: ${{ inputs.runner }}
306+
timeout-minutes: ${{ inputs.timeout_minutes }}
296307
steps:
297308
- name: Git checkout
298309
uses: actions/checkout@v3
@@ -305,6 +316,7 @@ jobs:
305316
name: 'Deploy the application'
306317
if: ${{ contains(inputs.ci_steps, 'deploy') }}
307318
runs-on: ${{ inputs.runner }}
319+
timeout-minutes: ${{ inputs.timeout_minutes }}
308320
steps:
309321
- name: Git checkout
310322
uses: actions/checkout@v3

0 commit comments

Comments
 (0)
Please sign in to comment.