forked from optuna/optuna
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (127 loc) · 4.66 KB
/
windows-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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Run tests and integration tests on Windows, which are triggered by each master push.
# Currently, Python3.9 is only used as an environment.
# This is mainly for the sake of speed.
name: windows-tests
on:
push:
branches:
- master
pull_request: {}
schedule:
- cron: '0 23 * * SUN-THU'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
tests-windows:
runs-on: windows-latest
# Not intended 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.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: windows-test
with:
path: ~\\AppData\\Local\\pip\\Cache
key: ${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1
restore-keys: |
${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
# TODO(Shinichi): Remove the version constraint on PyTorch Lightning
# TODO(c-bata): Remove the version constraint on fakeredis
- 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]
pip install "pytorch-lightning<2.0.0"
pip install PyQt6 # Install PyQT for using QtAgg as matplotlib backend.
pip install "fakeredis<2.11.1"
- name: Output installed packages
run: |
pip freeze --all
- name: Output dependency tree
run: |
pip install pipdeptree
pipdeptree
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest -m "not integration"
env:
SQLALCHEMY_WARN_20: 1
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.
- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest -m "not integration and not slow"
env:
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.
tests-integration-windows:
runs-on: windows-latest
# Not intended 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.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: windows-test-integration
with:
path: ~\\AppData\\Local\\pip\\Cache
key: ${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}-v1
restore-keys: |
${{ runner.os }}-3.9-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "msmpi"
# TODO(Shinichi): Remove the version constraint on PyTorch Lightning
# TODO(c-bata): Remove the version constraint on fakeredis
- 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]
pip install --progress-bar off .[integration]
pip install "pytorch-lightning<2.0.0"
pip install "distributed<2023.3.2"
pip install "fakeredis<2.11.1"
- name: Output installed packages
run: |
pip freeze --all
- name: Output dependency tree
run: |
pip install pipdeptree
pipdeptree
- name: Tests
# Skip allennlp tests since it's not supported on Windows.
# TODO(gen740): Don't skip mxnet, because mxnet is supported on Windows.
run: |
pytest tests -m "integration" `
--ignore tests/integration_tests/allennlp_tests/test_allennlp.py `
--ignore tests/integration_tests/test_mxnet.py
env:
OMP_NUM_THREADS: 1