[87e8bf]: / .github / workflows / python-app.yml

Download this file

127 lines (103 with data), 3.2 kB

  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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# This workflow will install Python dependencies, run tests
name: Python application
on:
push:
branches: [ "main" , "dev"]
paths-ignore:
- "docs/**"
- "**/README.md"
pull_request:
branches: [ "main" , "dev"]
paths-ignore:
- "docs/**"
- "**/README.md"
permissions:
contents: read
pull-requests: write
jobs:
build:
env:
DISPLAY: :0
defaults:
run:
shell: bash -l {0}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- name: Set environment variable for macOS
if: ${{ runner.os == 'macOS' }}
run: echo "SYSTEM_VERSION_COMPAT=0" >> $GITHUB_ENV
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Prepare Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update -y -qq
sudo apt-get install -y xvfb x11-xserver-utils
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Enable Conda (macOS)
if: ${{ runner.os == 'macOS' }}
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
python-version: "3.8"
- name: Enable Conda (window/ubuntu)
if: ${{ runner.os != 'macOS' }}
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
- name: Test Conda
run: |
conda info
CONDA_DEFAULT_ENV=test_myosuite
conda create --name $CONDA_DEFAULT_ENV python=3.8 -y
conda activate $CONDA_DEFAULT_ENV
# - name: Prepare MacOS
# if: ${{ runner.os == 'macOS' }}
# run: |
# brew install --cask xquartz
# brew install hdf5
# export CPATH="/opt/homebrew/include/"
# export HDF5_DIR=/opt/homebrew/
# pip3 install h5py --only-binary h5py
- name: Install dependencies
run: |
conda activate $CONDA_DEFAULT_ENV
python3 -m pip install --upgrade pip
pip3 install -e .
- name: Run MuJoCo Rendering test
if: ${{ runner.os == 'Linux' }}
run: python3 -m mujoco.render_test
- name: Test myoapi
run: |
conda activate $CONDA_DEFAULT_ENV
python3 -m myosuite.tests.test_myoapi
- name: Run Test environment
run: |
python3 -m myosuite.tests.test_myo
- name: Install ffmpeg
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get install --no-install-recommends ffmpeg && pip3 install ffmpeg scikit-video
- name: Test rendering
if: ${{ runner.os == 'Linux' }}
run: python3 -m myosuite.utils.examine_env -e myoElbowPose1D6MRandom-v0 -r offscreen -n 1
- name: Run Test jupyter-notebooks tutorials
if: ${{ runner.os == 'Linux' }}
run: |
source myosuite/tests/test_tutorials.sh
- name: Run Test gym/gymnasium + stable-baselines3
if: ${{ runner.os == 'Linux' }}
run: |
source myosuite/tests/test_versions.sh