forked from pytorch/botorch
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (74 loc) · 2.47 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
tests-and-coverage-pip:
name: Tests+coverage (pip, py${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14", "windows-latest"]
python-version: ["3.9", "3.11"]
exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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-14", "windows-latest"]
python-version: ["3.9", "3.11"]
exclude:
- os: "macos-14"
python-version: "3.9" # not available for macos-14
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
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: |
# avoid conda bug in >=23.10.0: https://github.com/conda/conda/issues/13412
conda config --set solver classic
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