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 <bjorn@neersighted.com>
  • Loading branch information
mkniewallner and neersighted committed Sep 24, 2022
1 parent 31ef8d7 commit aee025e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ 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
# XXX: https://github.com/pypa/pip/issues/11352 causes random failures -- remove once fixed in a release.
- name: Upgrade pip on 3.11 for macOS
Expand Down

0 comments on commit aee025e

Please sign in to comment.