@@ -252,3 +252,112 @@ jobs:
252
252
EXIT_STATUS=0
253
253
pytest test/smoke_test.py -v --durations 20
254
254
exit $EXIT_STATUS
255
+
256
+ build-wheel-windows :
257
+ runs-on : windows-latest
258
+ strategy :
259
+ matrix :
260
+ python_version : [["3.7", "3.7"], ["3.8", "3.8"], ["3.9", "3.9"], ["3.10", "3.10.3"]]
261
+ steps :
262
+ - name : Setup Python
263
+ uses : actions/setup-python@v2
264
+ with :
265
+ python-version : ${{ matrix.python_version[1] }}
266
+ - name : Checkout torchrl
267
+ uses : actions/checkout@v2
268
+ - name : Install PyTorch nightly
269
+ shell : bash
270
+ run : |
271
+ python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
272
+ - name : Build TorchRL nightly
273
+ shell : bash
274
+ run : |
275
+ rm -r dist || true
276
+ python3 -mpip install wheel
277
+ python3 setup.py bdist_wheel \
278
+ --package_name torchrl-nightly \
279
+ --python-tag=${{ matrix.python-tag }}
280
+ - name : Upload wheel for the test-wheel job
281
+ uses : actions/upload-artifact@v2
282
+ with :
283
+ name : torchrl-win-${{ matrix.python_version[0] }}.whl
284
+ path : dist/*.whl
285
+
286
+ test-wheel-windows :
287
+ needs : build-wheel-windows
288
+ runs-on : windows-latest
289
+ strategy :
290
+ matrix :
291
+ python_version : [["3.7", "3.7"], ["3.8", "3.8"], ["3.9", "3.9"], ["3.10", "3.10.3"]]
292
+ steps :
293
+ - name : Setup Python
294
+ uses : actions/setup-python@v2
295
+ with :
296
+ python-version : ${{ matrix.python_version[1] }}
297
+ - name : Checkout torchrl
298
+ uses : actions/checkout@v2
299
+ - name : Install PyTorch Nightly
300
+ shell : bash
301
+ run : |
302
+ python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
303
+ - name : Upgrade pip
304
+ shell : bash
305
+ run : |
306
+ python3 -mpip install --upgrade pip
307
+ - name : Install test dependencies
308
+ shell : bash
309
+ run : |
310
+ python3 -mpip install numpy pytest --no-cache-dir
311
+ - name : Download built wheels
312
+ uses : actions/download-artifact@v2
313
+ with :
314
+ name : torchrl-win-${{ matrix.python_version[0] }}.whl
315
+ path : wheels
316
+ - name : Install built wheels
317
+ shell : bash
318
+ run : |
319
+ python3 -mpip install wheels/*
320
+ - name : Log version string
321
+ shell : bash
322
+ run : |
323
+ # Avoid ambiguity of "import torchrl" by deleting the source files.
324
+ rm -rf torchrl/
325
+ python3 -c "import torchrl; print(torchrl.__version__)"
326
+ - name : Run tests
327
+ shell : bash
328
+ run : |
329
+ set -e
330
+ export IN_CI=1
331
+ mkdir test-reports
332
+ python -m torch.utils.collect_env
333
+ python -c "import torchrl; print(torchrl.__version__);from torchrl.data import ReplayBuffer"
334
+ EXIT_STATUS=0
335
+ pytest test/smoke_test.py -v --durations 20
336
+ exit $EXIT_STATUS
337
+
338
+ upload-wheel-windows :
339
+ needs : test-wheel-windows
340
+ runs-on : windows-latest
341
+ strategy :
342
+ matrix :
343
+ python_version : [["3.7", "3.7"], ["3.8", "3.8"], ["3.9", "3.9"], ["3.10", "3.10.3"]]
344
+ steps :
345
+ - name : Checkout torchrl
346
+ uses : actions/checkout@v2
347
+ - name : Download built wheels
348
+ uses : actions/download-artifact@v2
349
+ with :
350
+ name : torchrl-win-${{ matrix.python_version[0] }}.whl
351
+ path : wheels
352
+ - name : Push TorchRL Binary to PYPI
353
+ shell : bash
354
+ env :
355
+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
356
+ run : |
357
+ python3 -mpip install twine
358
+ python3 -m twine upload \
359
+ --username __token__ \
360
+ --password "$PYPI_TOKEN" \
361
+ --skip-existing \
362
+ wheels/torchrl_nightly-*.whl \
363
+ --verbose
0 commit comments