Rename reusable_test_pip.py to reusable_test_pip.yml #1
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: Reusable Test Workflow w/ pip | ||
on: | ||
workflow_call: | ||
inputs: | ||
use_latest_pytorch_gpytorch: | ||
required: true | ||
type: boolean | ||
upload_coverage: | ||
required: false | ||
type: boolean | ||
default: true | ||
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-14", "windows-latest"] | ||
python-version: ["3.10", "3.12"] | ||
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 (auto-install dependencies) | ||
if: ${{ !inputs.use_latest_pytorch_gpytorch }} | ||
run: | | ||
pip install .[test] | ||
- name: Install dependencies with latest PyTorch & GPyTorch | ||
if: ${{ inputs.use_latest_pytorch_gpytorch }} | ||
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: BoTorch | ||
run: | | ||
pytest -ra test/ --cov=botorch/ --cov-report term-missing | ||
- name: Unit tests and coverage: BoTorch Community | ||
run: | | ||
pytest -ra test_community/ --cov=botorch_community/ --cov-report term-missing | ||
- name: Upload coverage | ||
if: ${{ inputs.upload_coverage && runner.os == 'Linux' && matrix.python-version == 3.10 }} | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} |