forked from hill-a/stable-baselines
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 2.06 KB
/
ci.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
# Skip CI if [ci skip] in the commit message
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6] # Deactivate 3.5 build as it is not longer maintained
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install libopenmpi-dev
python -m pip install --upgrade pip
pip install wheel
pip install .[mpi,tests,docs]
# Use headless version
pip install opencv-python-headless
# Tmp fix: ROM missing in the newest atari-py version
pip install atari-py==0.2.5
- name: MPI
run: |
# check MPI
mpirun -h
python -c "import mpi4py; print(mpi4py.__version__)"
mpirun --allow-run-as-root -np 2 python -m stable_baselines.common.mpi_adam
mpirun --allow-run-as-root -np 2 python -m stable_baselines.ppo1.experiments.train_cartpole
mpirun --allow-run-as-root -np 2 python -m stable_baselines.common.mpi_running_mean_std
# MPI requires 3 processes to run the following code
# but will throw an error on GitHub CI as there is only two threads
# mpirun --allow-run-as-root -np 3 python -c "from stable_baselines.common.mpi_moments import _helper_runningmeanstd; _helper_runningmeanstd()"
- name: Build the doc
run: |
make doc
- name: Type check
run: |
make type
- name: Test with pytest
run: |
# Prevent issues with multiprocessing
DEFAULT_START_METHOD=fork make pytest