Test against stable #81
Workflow file for this run
This file contains hidden or 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 against stable | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| tests-and-coverage-stable: | |
| name: Test & Coverage | |
| uses: ./.github/workflows/reusable_test.yml | |
| with: | |
| use_latest_pytorch_gpytorch: false | |
| upload_coverage: false | |
| secrets: inherit | |
| tests-and-coverage-min-req: | |
| name: Tests and coverage min req. torch, gpytorch & linear_operator versions (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-14"] | |
| python-version: ["3.11", "3.14"] | |
| env: | |
| # `uv pip ...` requires venv by default. This skips that requirement. | |
| UV_SYSTEM_PYTHON: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| # Extract minimum versions from pyproject.toml | |
| min_torch_version=$(grep '"torch>=' pyproject.toml | sed 's/.*"torch>=\([^"]*\)".*/\1/') | |
| # The earliest PyTorch version on Python 3.14 available for all OS is 2.9.0. | |
| min_torch_version="$(if ${{ matrix.python-version == '3.14' }}; then echo "2.9.0"; else echo "${min_torch_version}"; fi)" | |
| # Torch <2.4 was built against numpy 1.x and is ABI-incompatible with numpy 2.x. | |
| numpy_constraint="$(if ${{ matrix.python-version == '3.14' }}; then echo ""; else echo "numpy<2"; fi)" | |
| min_gpytorch_version=$(grep '"gpytorch>=' pyproject.toml | sed 's/.*"gpytorch>=\([^"]*\)".*/\1/') | |
| min_linear_operator_version=$(grep '"linear_operator>=' pyproject.toml | sed 's/.*"linear_operator>=\([^"]*\)".*/\1/') | |
| uv pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}" ${numpy_constraint} | |
| uv pip install .[test] | |
| - name: Unit tests and coverage -- BoTorch | |
| run: | | |
| pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml | |
| - name: Unit tests and coverage -- BoTorch Community | |
| run: | | |
| pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml | |
| run_tutorials_stable: | |
| name: Run tutorials without smoke test on min req. versions of PyTorch & GPyTorch | |
| uses: ./.github/workflows/reusable_tutorials.yml | |
| with: | |
| smoke_test: false | |
| use_stable_pytorch_gpytorch: true | |
| run_tutorials_stable_smoke_test: | |
| name: Run tutorials with smoke test on min req. versions of PyTorch & GPyTorch | |
| uses: ./.github/workflows/reusable_tutorials.yml | |
| with: | |
| smoke_test: true | |
| use_stable_pytorch_gpytorch: true |