-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Actions Workflows (#1822)
Summary: - Update `checkout` and `python-setup` to v3 & v4, respectively. - Create a new `reusable_test` workflow and use this everywhere unit tests are ran. This supports pinned and latest BoTorch, as well as minimal and full dependencies. - Update the `reusable_tutorials` workflow to support both latest and pinned BoTorch. - Create a `cron_pinned` workflow and update `cron` to run only latest BoTorch version. This should make nightly cron into a much higher signal workflow and prevent it from failing due to latest Ax diverging from pinned BoTorch. Pull Request resolved: #1822 Reviewed By: Balandat Differential Revision: D49028887 Pulled By: saitcakmak fbshipit-source-id: 7426300da6724656dbcb0cf12c6b36a7cdd40838
- Loading branch information
1 parent
79c9705
commit 5dc443f
Showing
7 changed files
with
167 additions
and
132 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Nightly Cron with Pinned BoTorch | ||
|
||
on: | ||
schedule: | ||
# midnight EST | ||
- cron: '0 5 * * *' | ||
# allow this to be scheduled manually in addition to cron | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
tests-and-coverage-minimal: | ||
name: Tests with pinned BoTorch & minimal dependencies | ||
uses: ./.github/workflows/reusable_test.yml | ||
with: | ||
pinned_botorch: true | ||
minimal_dependencies: true | ||
|
||
tests-and-coverage-full: | ||
name: Tests with pinned BoTorch & full dependencies | ||
uses: ./.github/workflows/reusable_test.yml | ||
with: | ||
pinned_botorch: true | ||
minimal_dependencies: false | ||
|
||
build-tutorials: | ||
name: Build tutorials with pinned BoTorch | ||
uses: ./.github/workflows/reusable_tutorials.yml | ||
with: | ||
smoke_test: false | ||
pinned_botorch: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Reusable Test Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pinned_botorch: | ||
required: true | ||
type: boolean | ||
minimal_dependencies: | ||
required: false | ||
type: boolean | ||
default: false | ||
workflow_call: | ||
inputs: | ||
pinned_botorch: | ||
required: true | ||
type: boolean | ||
minimal_dependencies: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
tests-and-coverage: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10"] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- if: ${{ inputs.pinned_botorch }} | ||
name: Install dependencies with pinned BoTorch (minimal dependencies ${{ inputs.minimal_dependencies }}) | ||
run: | | ||
# The brackets returns '.[unittest_minimal]' if using minimal dependencies and '.[unittest]' | ||
# otherwise. This saves us from needing 4 install dependencies blocks by supporting two | ||
# different installation options in one line. | ||
pip install -e ${{ ((inputs.minimal_dependencies) && '.[unittest_minimal]') || '.[unittest]' }} | ||
- if: ${{ !inputs.pinned_botorch }} | ||
name: Install dependencies with latest BoTorch (minimal dependencies ${{ inputs.minimal_dependencies }}) | ||
env: | ||
ALLOW_BOTORCH_LATEST: true | ||
ALLOW_LATEST_GPYTORCH_LINOP: true | ||
run: | | ||
pip install git+https://github.com/cornellius-gp/gpytorch.git | ||
pip install git+https://github.com/pytorch/botorch.git | ||
pip install -e ${{ ((inputs.minimal_dependencies) && '.[unittest_minimal]') || '.[unittest]' }} | ||
- name: Import Ax | ||
run: | | ||
python scripts/import_ax.py | ||
- if: ${{ !inputs.minimal_dependencies }} | ||
# Only run with full dependencies. Minimal does not include pytest. | ||
name: Tests and coverage | ||
run: | | ||
pytest -ra --cov=ax | ||
- if: ${{ !inputs.minimal_dependencies }} | ||
# Using same condition as above since we need the coverage report for upload. | ||
name: Upload coverage | ||
run: | | ||
bash <(curl -s https://codecov.io/bash) |
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
Oops, something went wrong.