Fix PyTorch version in test-against-stable workflow #3694
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
tests-and-coverage-pip: | |
name: Tests and coverage (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
env: | |
ALLOW_LATEST_GPYTORCH_LINOP: true | |
run: | | |
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | |
pip install git+https://github.com/cornellius-gp/linear_operator.git | |
pip install git+https://github.com/cornellius-gp/gpytorch.git | |
pip install .[test] | |
- name: Unit tests and coverage | |
run: | | |
pytest -ra --cov=. --cov-report term-missing | |
- name: Upload coverage | |
if: ${{ runner.os == 'Linux' && matrix.python-version == 3.9 }} | |
run: | | |
bash <(curl -s https://codecov.io/bash) | |
tests-conda: | |
name: Tests (conda, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
activate-environment: test | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
shell: bash -l {0} | |
env: | |
ALLOW_LATEST_GPYTORCH_LINOP: true | |
run: | | |
conda install pytorch torchvision -c pytorch | |
conda install -y pip scipy sphinx pytest flake8 | |
pip install git+https://github.com/cornellius-gp/linear_operator.git | |
pip install git+https://github.com/cornellius-gp/gpytorch.git | |
pip install .[test] | |
- name: Unit tests | |
shell: bash -l {0} | |
run: | | |
pytest -ra |