From ed40a989a48fe028f778159baa463595275882e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Thu, 25 Apr 2024 15:15:07 +0200 Subject: [PATCH] CI: fix macOS and Windows builds (#416) * CI: Fix macOS build Constraints: - `macos-latest` is now ARM64. - Python 3.11 is the first macOS ARM release available in the action. So, we use macos-13 for older versions and stop unconditionally setting the architecture to x86, so that `macos-latest` uses ARM64 builds. * Pin to PyTorch 2.2.2 on Windows Until https://github.com/pytorch/pytorch/issues/124897 is resolved. --- .github/workflows/tests.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb6d7b67..374694a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,8 +10,8 @@ on: - "*.md" env: - MODULE_NAME: 'spacy_transformers' - RUN_MYPY: 'true' + MODULE_NAME: "spacy_transformers" + RUN_MYPY: "true" jobs: tests: @@ -21,16 +21,18 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python_version: ["3.11"] + python_version: ["3.12"] include: - - os: macos-latest + - os: macos-13 python_version: "3.7" - os: windows-latest python_version: "3.8" - os: ubuntu-latest python_version: "3.9" - - os: macos-latest + - os: macos-13 python_version: "3.10" + - os: windows-latest + python_version: "3.11" runs-on: ${{ matrix.os }} @@ -42,13 +44,18 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - architecture: x64 - name: Install oldest supported torch for python 3.6 if: matrix.python_version == '3.6' run: | python -m pip install "torch==1.8.1+cpu" -f https://download.pytorch.org/whl/torch_stable.html + # Remove when https://github.com/pytorch/pytorch/issues/124897 is fixed. + - name: Install torch 2.2.2 + if: matrix.python_version != '3.6' && matrix.os == 'windows-latest' + run: | + python -m pip install "torch==2.2.2+cpu" -f https://download.pytorch.org/whl/torch_stable.html + - name: Install dependencies run: | python -m pip install -U build pip setuptools wheel