Skip to content

tests-torch

tests-torch #8

Workflow file for this run

name: tests-torch
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: "9 9 * * 6" # every Saturday at 9:09 UTC
defaults:
run:
shell: bash
jobs:
############################################################
# Minimum requirements
############################################################
torch-minimum-agents:
name: Minimum requirements (agents)
runs-on: ubuntu-22.04
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9 # ast.unparse is not available in 3.8 (skrl/utils/model_instantiators)
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet "numpy<2.0" # 1.19.3
python -m pip install --quiet torch==1.10
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests
run: |
pytest \
--self-contained-html \
--html=torch-minimum-agents-pytest.html \
--cov=skrl/agents/torch \
--cov-report term:skip-covered \
--cov-report html:torch-minimum-agents-coverage.html \
tests/agents/torch
# report
- name: Save reports
uses: actions/upload-artifact@v4
with:
name: torch-minimum-agents.html
path: torch-minimum-agents-*.html
retention-days: 3
torch-minimum-envs:
name: Minimum requirements (envs)
runs-on: ubuntu-22.04
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet "numpy<2.0" # 1.19.3
python -m pip install --quiet torch==1.10
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests (Gymnasium)
run: |
python -m pip install --quiet gymnasium==0.26.1 pygame
python -m pip show gymnasium
pytest tests/envs/wrappers/torch/test_gymnasium_envs.py
- name: Run tests (Gym)
run: |
python -m pip install --quiet gym==0.23.0
python -m pip show gym
pytest tests/envs/wrappers/torch/test_gym_envs.py
- name: Run tests (PettingZoo)
run: |
python -m pip install --quiet pettingzoo==1.22.2 pymunk
python -m pip show pettingzoo
pytest tests/envs/wrappers/torch/test_pettingzoo_envs.py
- name: Run tests (Isaac Lab)
run: |
pytest tests/envs/wrappers/torch/test_isaaclab_envs.py
- name: Run tests (Omniverse Isaac Gym)
run: |
pytest tests/envs/wrappers/torch/test_omniverse_isaacgym_envs.py
- name: Run tests (Isaac Gym)
run: |
pytest tests/envs/wrappers/torch/test_isaacgym_envs.py
- name: Run tests (DeepMind Control Suite)
run: |
python -m pip install --quiet dm-control==1.0.15 mujoco==3.0.0
python -m pip show dm-control
pytest tests/envs/wrappers/torch/test_deepmind_envs.py
- name: Run tests (Brax)
run: |
python -m pip install --quiet brax==0.9.3 mujoco==3.0.0
python -m pip show brax
pytest tests/envs/wrappers/torch/test_brax_envs.py
torch-minimum-utils:
name: Minimum requirements (utils)
runs-on: ubuntu-22.04
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9 # ast.unparse is not available in 3.8 (skrl/utils/model_instantiators)
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet "numpy<2.0" # 1.19.3
python -m pip install --quiet torch==1.10
python -m pip install --quiet PyYAML
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests (model_instantiators)
run: |
python -m pip install --quiet gym==0.23.0
pytest \
--self-contained-html \
--html=torch-minimum-utils-model_instantiators-pytest.html \
--cov=skrl/utils/model_instantiators/torch \
--cov-report term:skip-covered \
--cov-report html:torch-minimum-utils-model_instantiators-coverage.html \
tests/utils/model_instantiators/torch
pytest \
--self-contained-html \
--html=torch-minimum-utils-spaces-pytest.html \
--cov=skrl/utils/spaces/torch \
--cov-report term:skip-covered \
--cov-report html:torch-minimum-utils-spaces-coverage.html \
tests/utils/spaces/torch
# report
- name: Save reports
uses: actions/upload-artifact@v4
with:
name: torch-minimum-utils.html
path: torch-minimum-utils-*.html
retention-days: 3
############################################################
# Latest requirements
############################################################
torch-latest-agents:
name: Latest requirements (agents)
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet numpy
python -m pip install --quiet torch
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests
run: |
pytest \
--self-contained-html \
--html=torch-latest-agents-pytest.html \
--cov=skrl/agents/torch \
--cov-report term:skip-covered \
--cov-report html:torch-latest-agents-coverage.html \
tests/agents/torch
# report
- name: Save reports
uses: actions/upload-artifact@v4
with:
name: torch-latest-agents_${{ matrix.os }}
path: torch-latest-agents-*.html
retention-days: 3
torch-latest-envs:
name: Latest requirements (envs)
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet numpy
python -m pip install --quiet torch
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests (Gymnasium)
run: |
python -m pip install --quiet gymnasium
python -m pip show gymnasium
pytest tests/envs/wrappers/torch/test_gymnasium_envs.py
- name: Run tests (Gym)
run: |
python -m pip install --quiet gym
python -m pip show gym
pytest tests/envs/wrappers/torch/test_gym_envs.py
- name: Run tests (PettingZoo)
run: |
python -m pip install --quiet pettingzoo pygame pymunk
python -m pip show pettingzoo
pytest tests/envs/wrappers/torch/test_pettingzoo_envs.py
- name: Run tests (Isaac Lab)
run: |
pytest tests/envs/wrappers/torch/test_isaaclab_envs.py
- name: Run tests (Omniverse Isaac Gym)
run: |
pytest tests/envs/wrappers/torch/test_omniverse_isaacgym_envs.py
- name: Run tests (Isaac Gym)
run: |
pytest tests/envs/wrappers/torch/test_isaacgym_envs.py
- name: Run tests (DeepMind Control Suite)
run: |
python -m pip install --quiet dm-control
python -m pip show dm-control
pytest tests/envs/wrappers/torch/test_deepmind_envs.py
- name: Run tests (Brax)
run: |
python -m pip install --quiet brax
python -m pip show brax
pytest tests/envs/wrappers/torch/test_brax_envs.py
torch-latest-utils:
name: Latest requirements (utils)
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
# setup
- uses: actions/checkout@v4
- name: Delete Python cache
if: env.DELETE_HOSTED_TOOL_PYTHON_CACHE == '1'
run: |
rm -rf /opt/hostedtoolcache/Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
check-latest: true
# install dependencies
- name: Install dependencies
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet numpy
python -m pip install --quiet torch
python -m pip install --quiet PyYAML
python -m pip install --quiet -e .[torch]
python -m pip install --quiet -e .[tests]
python -m pip show torch numpy
# run tests
- name: Run tests (model_instantiators)
run: |
python -m pip install --quiet gym
pytest \
--self-contained-html \
--html=torch-latest-utils-model_instantiators-pytest.html \
--cov=skrl/utils/model_instantiators/torch \
--cov-report term:skip-covered \
--cov-report html:torch-latest-utils-model_instantiators-coverage.html \
tests/utils/model_instantiators/torch
pytest \
--self-contained-html \
--html=torch-latest-utils-spaces-pytest.html \
--cov=skrl/utils/spaces/torch \
--cov-report term:skip-covered \
--cov-report html:torch-latest-utils-spaces-coverage.html \
tests/utils/spaces/torch
# report
- name: Save reports
uses: actions/upload-artifact@v4
with:
name: torch-latest-utils_${{ matrix.os }}
path: torch-latest-utils-*.html
retention-days: 3