Skip to content

Commit

Permalink
CI: fix macOS and Windows builds (#416)
Browse files Browse the repository at this point in the history
* 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 pytorch/pytorch#124897 is resolved.
  • Loading branch information
danieldk authored Apr 25, 2024
1 parent ba6bf82 commit ed40a98
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- "*.md"

env:
MODULE_NAME: 'spacy_transformers'
RUN_MYPY: 'true'
MODULE_NAME: "spacy_transformers"
RUN_MYPY: "true"

jobs:
tests:
Expand All @@ -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 }}

Expand All @@ -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
Expand Down

0 comments on commit ed40a98

Please sign in to comment.