Skip to content

Fix:1.fix advantage zero bug #489

Fix:1.fix advantage zero bug

Fix:1.fix advantage zero bug #489

Workflow file for this run

# Copyright 2026 Tensor Auto Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CPU Tests
on:
workflow_dispatch:
pull_request:
push:
permissions:
contents: read
env:
GIT_LFS_SKIP_SMUDGE: "1"
GIT_CLEAN_FLAGS: "-ffdx -e .venv/"
PYTORCH_CUDA_ALLOC_CONF: "expandable_segments:True"
UV_LINK_MODE: "copy"
MUJOCO_GL: "egl"
PYOPENGL_PLATFORM: "egl"
PRE_COMMIT_HOME: "/pre-commit-cache"
jobs:
cpu-tests:
name: CPU Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
persist-credentials: false
lfs: false
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg libegl1 libegl-mesa0 libgl1 libglx-mesa0 libgles2 mesa-utils
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Verify uv installation
run: |
which uv
uv --version
- name: Install dependencies
run: |
uv sync --extra dev --extra libero
- name: Activate virtual environment and verify Python
run: |
source .venv/bin/activate
which python3
python3 --version
- name: Verify ffmpeg
run: ffmpeg -version
- name: Set up HuggingFace authentication
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source .venv/bin/activate
hf auth login --token $HF_TOKEN
- name: Configure wandb
run: |
source .venv/bin/activate
wandb offline
- name: Check disk space
run: df -h /dev/shm
- name: Run CPU tests with coverage
run: |
source .venv/bin/activate
mkdir -p /tmp/libero-assets/libero/libero
export LIBERO_CONFIG_PATH="$(pwd)/.github/assets/libero"
echo LIBERO_CONFIG_PATH is $LIBERO_CONFIG_PATH
python3 -c "import sys; print(sys.path)"
python3 -c "import libero.libero" && echo "LIBERO config set successfully."
echo "Running cpu based pytest and generating coverage report..."
pytest -m "not gpu" -n auto -v --cov=lerobot/ --cov-report=xml:cpu_test/cpu_test.xml --ignore=tests/planner/test_planner.py --ignore tests/utils/test_libero_utils.py --deselect=tests/envs/test_factory.py::TestMakeEnv::test_make_env_async_vector_env --deselect=tests/envs/test_factory.py::TestMakeEnv::test_make_env_sync_vector_env tests/
echo "Pytest execution and coverage report generation completed."
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
file: ./cpu_test/cpu_test.xml
flags: cpu
name: cpu-coverage
fail_ci_if_error: false