-
-
Notifications
You must be signed in to change notification settings - Fork 602
/
config.yml
319 lines (306 loc) · 9.93 KB
/
config.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
version: 2.1
parameters:
plugin_test:
type: boolean
default: False
test_plugins:
type: string
default: ""
cache_key_version:
type: string
default: v1
commands:
early_return_for_forked_pull_requests:
description: >-
If this build is from a fork, stop executing the current job and return success.
This is useful to avoid steps that will fail due to missing credentials.
steps:
- run:
name: Early return if this build is from a forked PR
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
macos:
description: Commands run on MacOS
parameters:
py_version:
type: string
steps:
- checkout
- restore_cache:
key: -<< pipeline.parameters.cache_key_version >>-macos-sys-{{ .Branch }}-<< parameters.py_version >>
- run:
name: Preparing environment - Conda
command: |
if [[ -f ~/miniconda3/LICENSE.txt ]] ; then
echo "miniconda installed already."
else
curl -o Miniconda3-py38_4.8.3-MacOSX-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-MacOSX-x86_64.sh
bash ./Miniconda3-py38_4.8.3-MacOSX-x86_64.sh -b
fi
~/miniconda3/bin/conda init bash
- run:
name: Preparing environment - Brew
command: |
brew update
brew upgrade git
brew install fish
brew install zsh
brew cleanup
- run:
name: Preparing environment - Hydra
command: |
conda create -n hydra python=<< parameters.py_version >> -yq
conda run -n hydra pip install nox --progress-bar off
- save_cache:
key: -<< pipeline.parameters.cache_key_version >>-macos-sys-{{ .Branch }}-<< parameters.py_version >>
paths:
- ~/miniconda3
- ~/Library/Caches/Homebrew
linux:
description: Commands run on Linux
parameters:
py_version:
type: string
steps:
- checkout
- run:
name: Preparing environment - Conda
command: |
curl -o Miniconda3-py38_4.8.3-Linux-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh
bash ./Miniconda3-py38_4.8.3-Linux-x86_64.sh -b
- run:
name: Preparing environment - Other dependency
command: |
sudo apt-get update
sudo apt-get install -y expect fish zsh openjdk-11-jre rsync
- run:
name: Preparing environment - Hydra
command: |
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda create -n hydra python=<< parameters.py_version >> -yq
win:
description: Commands run on Windows
parameters:
py_version:
type: string
steps:
- checkout
- restore_cache:
key: -<< pipeline.parameters.cache_key_version >>-win-sys-{{ .Branch }}-<< parameters.py_version >>
- run:
name: Preparing environment - system
command: |
choco install -y --no-progress miniconda3
choco install -y --no-progress openssl javaruntime
C:\tools\miniconda3\Scripts\conda.exe init powershell
- run:
name: Preparing environment - Hydra
command: |
conda create -n hydra python=<< parameters.py_version >> -qy
conda activate hydra
pip install nox dataclasses --progress-bar off
- save_cache:
key: -<< pipeline.parameters.cache_key_version >>-win-sys-{{ .Branch }}-<< parameters.py_version >>
paths:
- C:\tools\miniconda3
jobs:
test_macos:
parameters:
py_version:
type: string
macos:
xcode: "12.0.0"
steps:
- macos:
py_version: << parameters.py_version >>
- run:
name: Testing Hydra
no_output_timeout: 10m
command: |
export NOX_PYTHON_VERSIONS=<< parameters.py_version >>
conda activate hydra
pip install nox dataclasses --progress-bar off
nox -s lint test_tools test_core test_jupyter_notebooks -ts
if [ -n "$CIRCLE_PR_NUMBER" ]; then
SKIP_PLUGINS=hydra_ray_launcher nox -s lint_plugins test_plugins -ts
fi
test_linux:
parameters:
py_version:
type: string
docker:
- image: cimg/base:stable-18.04
steps:
- linux:
py_version: << parameters.py_version >>
- run:
name: Testing Hydra
command: |
export PATH="$HOME/miniconda3/envs/hydra/bin:$PATH"
export NOX_PYTHON_VERSIONS=<< parameters.py_version >>
pip install nox dataclasses --progress-bar off
nox -s lint test_tools test_core test_jupyter_notebooks -ts
if [ -n "$CIRCLE_PR_NUMBER" ]; then
SKIP_PLUGINS=hydra_ray_launcher nox -s lint_plugins test_plugins -ts
fi
test_win:
parameters:
py_version:
type: string
executor: win/default
steps:
- win:
py_version: << parameters.py_version >>
- run:
name: Testing Hydra
no_output_timeout: 10m
command: |
$env:NOX_PYTHON_VERSIONS="<< parameters.py_version >>"
$env:PYTHONIOENCODING="utf_8"
conda activate hydra
nox -s lint test_tools test_core test_jupyter_notebooks -ts
If ($CIRCLE_PR_NUMBER) {SKIP_PLUGINS=hydra_ray_launcher nox -s lint_plugins test_plugins -ts}
exit $LASTEXITCODE
trigger_plugin_pipelines:
docker:
- image: circleci/python:3.8
steps:
- early_return_for_forked_pull_requests
- checkout
- run:
name: Kick off Plugin tests
command: |
python tools/ci/circleci_pipeline.py
echo "Done kicking off plugin tests."
test_plugin_macos:
parameters:
py_version:
type: string
test_plugin:
type: string
macos:
xcode: "12.0.0"
steps:
- macos:
py_version: << parameters.py_version >>
- run:
name: << parameters.test_plugin >>
no_output_timeout: 10m
command: |
export NOX_PYTHON_VERSIONS=<< parameters.py_version >>
export PLUGINS=<< parameters.test_plugin >>
conda activate hydra
pip install nox dataclasses --progress-bar off
nox -s lint_plugins test_plugins -ts
test_plugin_linux:
parameters:
py_version:
type: string
test_plugin:
type: string
docker:
- image: cimg/base:stable-18.04
# https://github.com/facebookresearch/hydra/pull/1691
resource_class: medium+
steps:
- linux:
py_version: << parameters.py_version >>
- run:
name: << parameters.test_plugin >>
command: |
export PATH="$HOME/miniconda3/envs/hydra/bin:$PATH"
export NOX_PYTHON_VERSIONS=<< parameters.py_version >>
export PLUGINS=<< parameters.test_plugin >>
pip install nox dataclasses --progress-bar off
nox -s lint_plugins test_plugins -ts
test_plugin_win:
parameters:
py_version:
type: string
test_plugin:
type: string
executor: win/default
steps:
- win:
py_version: << parameters.py_version >>
- run:
name: << parameters.test_plugin >>
no_output_timeout: 10m
command: |
$env:NOX_PYTHON_VERSIONS=<< parameters.py_version >>
$env:ConEmuDefaultCp=65001
$env:PYTHONIOENCODING="utf_8"
$env:PLUGINS="<< parameters.test_plugin >>"
conda activate hydra
nox -s lint_plugins test_plugins -ts
exit $LASTEXITCODE
test_linux_omc_dev:
parameters:
py_version:
type: string
docker:
- image: cimg/base:stable-18.04
steps:
- linux:
py_version: << parameters.py_version >>
- run:
name: Testing Hydra
command: |
export PATH="$HOME/miniconda3/envs/hydra/bin:$PATH"
export NOX_PYTHON_VERSIONS=<< parameters.py_version >>
export USE_OMEGACONF_DEV_VERSION=1
pip install nox dataclasses --progress-bar off
nox -s test_core -ts
# Misc
coverage:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run: sudo pip install nox --progress-bar off
- run: nox -s coverage
workflows:
version: 2
core_tests:
unless: << pipeline.parameters.plugin_test >>
jobs:
- trigger_plugin_pipelines
- test_macos:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- test_linux:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- test_win:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- test_linux_omc_dev:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
plugin_tests:
when: << pipeline.parameters.plugin_test >>
jobs:
- test_plugin_linux:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
test_plugin: [<< pipeline.parameters.test_plugins >>]
- test_plugin_macos:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
test_plugin: [<< pipeline.parameters.test_plugins >>]
- test_plugin_win:
matrix:
parameters:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
test_plugin: [<< pipeline.parameters.test_plugins >>]
orbs:
win: circleci/windows@2.2.0