forked from optuna/optuna
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.96 KB
/
matplotlib-tests.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
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@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: test-matplotlib
with:
path: ~/.cache/pip
key: ${{ runner.os }}-3.12-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1
restore-keys: |
${{ runner.os }}-3.12-${{ 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] --extra-index-url https://download.pytorch.org/whl/cpu
pip install --progress-bar off .[optional] --extra-index-url https://download.pytorch.org/whl/cpu
- 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