-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ci: don't timeout if the runner is slow to pick up the job #1521
Merged
Merged
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
9947743
try
maxime-desroches 0ad6d8b
test
maxime-desroches e7a8e41
fix
maxime-desroches f9df779
try
maxime-desroches 3755bf6
;
maxime-desroches d93bc85
;;
maxime-desroches 1671332
fix
maxime-desroches 5fe656d
try
maxime-desroches 2f688e5
try
maxime-desroches 456d600
fix this
maxime-desroches a126f7c
fix
maxime-desroches d1c2f02
fix
maxime-desroches 147d597
fix
maxime-desroches 2571802
fix
maxime-desroches 2911567
fix
maxime-desroches ae04a51
fix
maxime-desroches b1fa2bb
fix
maxime-desroches 1113175
try
maxime-desroches 0a468d9
try failure
maxime-desroches 34c0373
works
maxime-desroches 0bbc8b6
better
maxime-desroches 0114ed8
comma
maxime-desroches 599f4e4
test
maxime-desroches b450d85
cleanup
maxime-desroches File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'timeout' | ||
|
||
inputs: | ||
duration: | ||
description: 'Maximum duration allowed for a workflow' | ||
required: false | ||
default: 60 | ||
start_time: | ||
description: 'Starting time of the workflow' | ||
required: false | ||
default: -1 | ||
outputs: | ||
start_time: | ||
description: 'Saved starting time of the workflow' | ||
value: ${{ steps.timeout-check.outputs.start_time }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- if: ${{ inputs.start_time >= 0 }} | ||
shell: bash | ||
run: | | ||
if [[ $(( $(date +%s) - ${{ inputs.start_time }} )) -gt ${{ inputs.duration }} ]]; then | ||
echo -e "\033[0;31mTHIS WORKFLOW TOOK MORE THAN ${{ inputs.duration }}s !\033[0m" && exit 1; | ||
fi | ||
- id: timeout-check | ||
shell: bash | ||
run: | | ||
echo "start_time=$(date +%s)" >> "$GITHUB_OUTPUT" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other actions have something like a "Post checkout" that runs at the end. can we do that here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only possible with JS actions. Created a really simple one here: https://github.com/commaai/timeout
We now only have to do this once:
or to specify a timeout other than 60 seconds: