forked from pytorch/botorch
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (128 loc) · 4.63 KB
/
nightly.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Nightly Cron
on:
schedule:
# 2:30 PST
- cron: '30 10 * * *'
workflow_dispatch:
jobs:
tests-and-coverage-nightly:
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)
package-test-deploy-pypi:
name: Package and test deployment to test.pypi.org
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- 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]
pip install --upgrade build setuptools setuptools_scm wheel
- name: Extract reduced version and save to env var
# strip the commit hash from the version to enable upload to pypi
# env var will persist for subsequent steps
run: |
no_local_version=$(python -m setuptools_scm | cut -d "+" -f 1)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=${no_local_version}" >> $GITHUB_ENV
- name: Build packages (wheel and source distribution)
env:
ALLOW_LATEST_GPYTORCH_LINOP: true
run: |
python -m build --sdist --wheel
- name: Verify packages
env:
ALLOW_LATEST_GPYTORCH_LINOP: true
run: |
./scripts/build_and_verify_py_packages.sh
- name: Deploy to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
verbose: true
package-conda:
name: Test conda build
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: test
python-version: "3.9"
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install dependencies
shell: bash -l {0}
env:
ALLOW_LATEST_GPYTORCH_LINOP: true
# Don't need most deps for conda build, but need them for testing
# We do need setuptools_scm though to properly parse the version
run: |
conda install -y scipy multipledispatch setuptools_scm conda-build conda-verify
conda config --set anaconda_upload no
conda install -y -c pytorch-nightly pytorch cpuonly
conda install -y -c conda-forge pyro-ppl>=1.8.4
pip install git+https://github.com/cornellius-gp/linear_operator.git
pip install git+https://github.com/cornellius-gp/gpytorch.git
- name: Build and verify conda package
shell: bash -l {0}
run: |
./scripts/build_and_verify_conda_package.sh
publish-latest-website:
name: Publish latest website
needs: [tests-and-coverage-nightly, package-test-deploy-pypi, package-conda]
uses: ./.github/workflows/reusable_website.yml
with:
publish_versioned_website: false
secrets: inherit
run_tutorials:
name: Run tutorials without smoke test on latest PyTorch / GPyTorch / Ax
uses: ./.github/workflows/reusable_tutorials.yml
with:
smoke_test: false
use_stable_pytorch_gpytorch: false
use_stable_ax: false
upload_artifact: true