-
Notifications
You must be signed in to change notification settings - Fork 8
109 lines (94 loc) · 4.04 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
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
name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [1.76.0]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.rust-target }}
profile: minimal
default: true
- if: matrix.platform.os == 'ubuntu-latest'
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV
- if: matrix.os == 'ubuntu-latest'
name: Install gym (Ubuntu)
run: |
pip install --upgrade pip
pip install swig==4.2.1
pip install mujoco==2.3.7
pip install gymnasium==0.29.1
pip install gymnasium-robotics==1.2.2
pip install pybullet==3.2.5
pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu
- if: matrix.os != 'ubuntu-latest'
name: Install gym (Windows/Mac)
run: |
pip install --upgrade pip
pip install swig==4.2.1
pip install gymnasium==0.29.1
pip install pybullet==3.2.5
pip install torch==2.3.0
- if: matrix.os == 'ubuntu-latest'
name: Install pybullet-gym
run: |
git clone https://github.com/benelot/pybullet-gym.git
cd pybullet-gym
sed -i 's/return state, sum(self.rewards), bool(done), {}/return state, sum(self.rewards), bool(done), bool(done), {}/g' ./pybulletgym/envs/roboschool/envs/locomotion/walker_base_env.py
sed -i 's/id='\''AntPyBulletEnv-v0'\'',/id='\''AntPyBulletEnv-v0'\'', order_enforce=False,/g' ./pybulletgym/envs/__init__.py
pip install -e .
- if: matrix.os != 'windows-latest'
name: Set PYTHONPATH (Linux, macOS)
run: echo "PYTHONPATH=$PWD/border-py-gym-env/examples" >> $GITHUB_ENV
shell: bash
- if: matrix.os == 'windows-latest'
name: Set PYTHONPATH (Windows)
run: echo "PYTHONPATH=$pwd\border-py-gym-env\examples" >> $env:GITHUB_ENV
- name: Test border-core
run: cargo test -p border-core
- name: Test border-py-gym-env
run: cargo test -p border-py-gym-env
- if: matrix.os == 'ubuntu-latest'
name: Check env vars
run: printenv
- if: matrix.os == 'ubuntu-latest'
name: Test border examples
env:
LIBTORCH_USE_PYTORCH: 1
run: |
export LD_LIBRARY_PATH=`pip show torch | awk '/Location/ {print $2}'`/torch/lib:$LD_LIBRARY_PATH
printenv | grep LD_
sudo apt-get update
sudo apt-get install -y --no-install-recommends --fix-missing \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev \
libsdl2-dev libsdl-image1.2-dev
cargo test --example dqn_cartpole_tch --features=tch
cargo test --example iqn_cartpole_tch --features=tch
cargo test --example sac_pendulum_tch --features=tch
cargo test --example dqn_cartpole --features=candle-core
cargo test --example sac_pendulum --features=candle-core
cd border-async-trainer; cargo test; cd ..
cd border-atari-env; cargo test; cd ..
cd border-candle-agent; cargo test; cd ..
cd border-tch-agent; cargo test; cd ..
cd border-policy-no-backend; cargo test --features=border-tch-agent; cd ..
cd border-py-gym-env; cargo test; cd ..