Skip to content

Commit

Permalink
ci: define timeout on macOS
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Neergaard <[email protected]>
Applying the same fix as in
python-poetry/poetry#6618.
  • Loading branch information
mkniewallner authored and neersighted committed Oct 11, 2022
1 parent ed8c17d commit 021317b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ jobs:

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
run: |
# `timeout` is not available on macOS, so we define a custom function.
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
timeout 10s poetry run pip --version || rm -rf .venv
- name: Install dependencies
run: poetry install
Expand Down

0 comments on commit 021317b

Please sign in to comment.