optimized sub optimal code #322
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_call: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install TA-Lib | |
run: | | |
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | |
tar -xzf ta-lib-0.4.0-src.tar.gz | |
cd ta-lib/ | |
sudo ./configure | |
sudo make | |
sudo make install | |
cd .. | |
sudo rm -rf ta-lib | |
- name: Install PyTorch | |
run: | | |
sudo pip3 install torch --index-url https://download.pytorch.org/whl/cu118 | |
echo "LIBTORCH_USE_PYTORCH=1" >> $GITHUB_ENV | |
echo "LIBTORCH_BYPASS_VERSION_CHECK=1" >> $GITHUB_ENV | |
LIBTORCH_PATH=$(python -c "import torch; from torch.utils import cpp_extension; print(cpp_extension.library_paths()[0])") | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBTORCH_PATH" >> $GITHUB_ENV | |
- name: Install MuJoCo | |
run: | | |
MUJOCO_URL_LATEST=$(curl -s https://api.github.com/repos/google-deepmind/mujoco/releases/latest | grep browser_download_url | grep linux.x86_64.tar.gz | cut -d '"' -f 4 | sed '1p;d') | |
curl -L $MUJOCO_URL_LATEST > mujoco.tar.gz && tar -xvzf mujoco.tar.gz | |
sudo cp -r $(ls | grep mujoco | sed '1p;d') ~/.local/mujoco/ | |
sudo cp -a ~/.local/mujoco/lib/. /usr/lib/ | |
sudo cp -a ~/.local/mujoco/include/. /usr/include/ | |
- name: Install GLFW Depends | |
run: | | |
sudo apt-get update | |
sudo apt-get install xorg-dev libglu1-mesa-dev | |
- uses: actions/checkout@master | |
- uses: actions/cache@master | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Update Rust Toolchain | |
run: rustup update | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose |