forked from optuna/optuna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request optuna#5263 from DanielAvdar/matplotlib-tests
Add CI settings to test Matplotlib without Plotly
- Loading branch information
Showing
2 changed files
with
68 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: matplotlib-tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/matplotlib-tests.yml | ||
- optuna/visualization/**.py | ||
- tests/visualization_tests/** | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
matplotlib-tests: | ||
runs-on: ubuntu-latest | ||
|
||
# Scheduled Tests are disabled for forks. | ||
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: test-matplotlib | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-3.8-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1 | ||
restore-keys: | | ||
${{ runner.os }}-3.8-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --progress-bar off -U setuptools | ||
# Install minimal dependencies and confirm that `import optuna` is successful. | ||
pip install --progress-bar off . | ||
python -c 'import optuna' | ||
optuna --version | ||
pip install --progress-bar off .[test] | ||
pip install --progress-bar off .[optional] | ||
- name: Output installed packages | ||
run: | | ||
pip freeze --all | ||
- name: Output dependency tree | ||
run: | | ||
pip install pipdeptree | ||
pipdeptree | ||
- name: Tests without Plotly | ||
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} | ||
run: | | ||
pip uninstall -y plotly | ||
pytest tests/visualization_tests/matplotlib_tests | ||
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