|
18 | 18 | max-parallel: 4 |
19 | 19 | matrix: |
20 | 20 | os: [Ubuntu, MacOS, Windows] |
21 | | - python-version: [3.7, 3.8, 3.9, "3.10"] |
| 21 | + python-version: [3.7, 3.8, 3.9, "3.10", "3.11-dev"] |
22 | 22 |
|
23 | 23 | defaults: |
24 | 24 | run: |
|
28 | 28 | - uses: actions/checkout@v3 |
29 | 29 |
|
30 | 30 | - name: Set up Python ${{ matrix.python-version }} |
31 | | - uses: actions/setup-python@v3 |
| 31 | + uses: actions/setup-python@v4 |
32 | 32 | with: |
33 | 33 | python-version: ${{ matrix.python-version }} |
34 | 34 |
|
@@ -61,13 +61,25 @@ jobs: |
61 | 61 | key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} |
62 | 62 |
|
63 | 63 | - name: Ensure cache is healthy |
64 | | - if: steps.cache.outputs.cache-hit == 'true' && matrix.os != 'MacOS' |
65 | | - run: timeout 10s poetry run pip --version || rm -rf .venv |
| 64 | + if: steps.cache.outputs.cache-hit == 'true' |
| 65 | + run: | |
| 66 | + # `timeout` is not available on macOS, so we define a custom function. |
| 67 | + [ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } |
| 68 | + # Using `timeout` is a safeguard against the Poetry command hanging for some reason. |
| 69 | + timeout 10s poetry run pip --version || rm -rf .venv |
| 70 | +
|
| 71 | + # XXX: https://github.com/pypa/pip/issues/11352 causes random failures -- remove once fixed in a release. |
| 72 | + - name: Upgrade pip on 3.11 for macOS |
| 73 | + if: ${{ matrix.python-version == '3.11-dev' && matrix.os == 'macOS' }} |
| 74 | + run: poetry run pip install git+https://github.com/pypa/pip.git@fbb7f0b293f1d9289d8c76a556540325b9a172b2 |
66 | 75 |
|
67 | 76 | - name: Install dependencies |
68 | 77 | shell: bash |
69 | 78 | run: poetry install |
70 | 79 |
|
| 80 | + - name: Run mypy |
| 81 | + run: poetry run mypy |
| 82 | + |
71 | 83 | - name: Run pytest |
72 | 84 | shell: bash |
73 | 85 | run: poetry run pytest -v tests |
0 commit comments