Add crate border-policy-no-backend #524
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .. |