From 2504d007076a63de0a69767738e7fd09c020fd28 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Tue, 24 Feb 2026 11:56:13 +0100 Subject: [PATCH] feat(ci): log into HF to unblock some CI tests --- .github/workflows/fast_tests.yml | 6 ++++++ .github/workflows/full_tests.yml | 11 +++++++++++ .../pi0_fast/test_pi0_fast_original_vs_lerobot.py | 5 ----- tests/policies/pi0_pi05/test_pi0.py | 9 --------- tests/policies/pi0_pi05/test_pi05.py | 12 +----------- tests/policies/pi0_pi05/test_pi05_rtc.py | 9 --------- tests/policies/pi0_pi05/test_pi0_rtc.py | 9 --------- tests/policies/wall_x/test_wallx.py | 8 -------- 8 files changed, 18 insertions(+), 51 deletions(-) diff --git a/.github/workflows/fast_tests.yml b/.github/workflows/fast_tests.yml index 10ec91199..1210a6d73 100644 --- a/.github/workflows/fast_tests.yml +++ b/.github/workflows/fast_tests.yml @@ -61,6 +61,7 @@ jobs: MUJOCO_GL: egl HF_HOME: /mnt/cache/.cache/huggingface HF_LEROBOT_HOME: /mnt/cache/.cache/huggingface/lerobot + HF_TOKEN: ${{ secrets.LEROBOT_HF_USER }} steps: - uses: actions/checkout@v6 with: @@ -89,5 +90,10 @@ jobs: - name: Install lerobot with test extras run: uv sync --extra "test" + - name: Login to Hugging Face + run: | + uv run huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential + uv run huggingface-cli whoami + - name: Run pytest run: uv run pytest tests -vv --maxfail=10 diff --git a/.github/workflows/full_tests.yml b/.github/workflows/full_tests.yml index fd5e422b3..799c3f59d 100644 --- a/.github/workflows/full_tests.yml +++ b/.github/workflows/full_tests.yml @@ -60,6 +60,7 @@ jobs: MUJOCO_GL: egl HF_HOME: /mnt/cache/.cache/huggingface HF_LEROBOT_HOME: /mnt/cache/.cache/huggingface/lerobot + HF_TOKEN: ${{ secrets.LEROBOT_HF_USER }} steps: - uses: actions/checkout@v6 with: @@ -87,6 +88,11 @@ jobs: - name: Install lerobot with all extras run: uv sync --extra all # TODO(Steven): Make flash-attn optional + - name: Login to Hugging Face + run: | + uv run huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential + uv run huggingface-cli whoami + - name: Run pytest (all extras) run: uv run pytest tests -vv --maxfail=10 @@ -162,6 +168,7 @@ jobs: HF_LEROBOT_HOME: /home/user_lerobot/.cache/huggingface/lerobot TORCH_HOME: /home/user_lerobot/.cache/torch TRITON_CACHE_DIR: /home/user_lerobot/.cache/triton + HF_TOKEN: ${{ secrets.LEROBOT_HF_USER }} container: image: ${{ needs.build-and-push-docker.outputs.image_tag }} # zizmor: ignore[unpinned-images] options: --gpus all --shm-size "16gb" @@ -173,6 +180,10 @@ jobs: shell: bash working-directory: /lerobot steps: + - name: Login to Hugging Face + run: | + huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential + huggingface-cli whoami - name: Run pytest on GPU run: pytest tests -vv --maxfail=10 - name: Run end-to-end tests diff --git a/tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py b/tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py index 9ebc4ba89..e71811eee 100644 --- a/tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py +++ b/tests/policies/pi0_fast/test_pi0_fast_original_vs_lerobot.py @@ -17,7 +17,6 @@ """Test script to verify PI0Fast policy integration with LeRobot vs the original implementation""" # ruff: noqa: E402 -import os import random from copy import deepcopy from typing import Any @@ -28,10 +27,6 @@ import torch pytest.importorskip("transformers") pytest.importorskip("scipy") -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires accepting the model license", -) from lerobot.policies.pi0_fast.configuration_pi0_fast import PI0FastConfig from lerobot.policies.pi0_fast.modeling_pi0_fast import PI0FastPolicy diff --git a/tests/policies/pi0_pi05/test_pi0.py b/tests/policies/pi0_pi05/test_pi0.py index b580310eb..e83abf57d 100644 --- a/tests/policies/pi0_pi05/test_pi0.py +++ b/tests/policies/pi0_pi05/test_pi0.py @@ -16,17 +16,8 @@ """Test script to verify PI0 policy integration with LeRobot, only meant to be run locally!""" -import os - -import pytest import torch -# Skip this entire module in CI -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires local OpenPI installation and is not meant for CI", -) - from lerobot.policies.factory import make_policy_config # noqa: E402 from lerobot.policies.pi0 import ( # noqa: E402 PI0Config, diff --git a/tests/policies/pi0_pi05/test_pi05.py b/tests/policies/pi0_pi05/test_pi05.py index 964539446..595191689 100644 --- a/tests/policies/pi0_pi05/test_pi05.py +++ b/tests/policies/pi0_pi05/test_pi05.py @@ -16,25 +16,15 @@ """Test script to verify PI0.5 (pi05) support in PI0 policy, only meant to be run locally!""" -import os - -import pytest import torch -from lerobot.utils.random_utils import set_seed - -# Skip this entire module in CI -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires local OpenPI installation and is not meant for CI", -) - from lerobot.policies.factory import make_policy_config # noqa: E402 from lerobot.policies.pi05 import ( # noqa: E402 PI05Config, PI05Policy, make_pi05_pre_post_processors, # noqa: E402 ) +from lerobot.utils.random_utils import set_seed from tests.utils import require_cuda # noqa: E402 diff --git a/tests/policies/pi0_pi05/test_pi05_rtc.py b/tests/policies/pi0_pi05/test_pi05_rtc.py index 3a753031f..ef5995a95 100644 --- a/tests/policies/pi0_pi05/test_pi05_rtc.py +++ b/tests/policies/pi0_pi05/test_pi05_rtc.py @@ -16,17 +16,8 @@ """Test PI0.5 policy with Real-Time Chunking (RTC) enabled during inference.""" -import os - -import pytest import torch -# Skip this entire module in CI -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires local OpenPI installation and is not meant for CI", -) - from lerobot.configs.types import FeatureType, PolicyFeature, RTCAttentionSchedule # noqa: E402 from lerobot.policies.pi05 import PI05Config, PI05Policy, make_pi05_pre_post_processors # noqa: E402 from lerobot.policies.rtc.configuration_rtc import RTCConfig # noqa: E402 diff --git a/tests/policies/pi0_pi05/test_pi0_rtc.py b/tests/policies/pi0_pi05/test_pi0_rtc.py index 68e94dd94..3c9e7a8bf 100644 --- a/tests/policies/pi0_pi05/test_pi0_rtc.py +++ b/tests/policies/pi0_pi05/test_pi0_rtc.py @@ -16,17 +16,8 @@ """Test PI0 policy with Real-Time Chunking (RTC) enabled during inference.""" -import os - -import pytest import torch -# Skip this entire module in CI -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires local OpenPI installation and is not meant for CI", -) - from lerobot.configs.types import FeatureType, PolicyFeature, RTCAttentionSchedule # noqa: E402 from lerobot.policies.pi0 import PI0Config, PI0Policy, make_pi0_pre_post_processors # noqa: E402 from lerobot.policies.rtc.configuration_rtc import RTCConfig # noqa: E402 diff --git a/tests/policies/wall_x/test_wallx.py b/tests/policies/wall_x/test_wallx.py index e5f124123..dcd37b8ef 100644 --- a/tests/policies/wall_x/test_wallx.py +++ b/tests/policies/wall_x/test_wallx.py @@ -16,8 +16,6 @@ """Test script to verify Wall-X policy integration with LeRobot, only meant to be run locally!""" -import os - import pytest import torch @@ -26,12 +24,6 @@ pytest.importorskip("peft") pytest.importorskip("transformers") pytest.importorskip("torchdiffeq") -# Skip this entire module in CI -pytestmark = pytest.mark.skipif( - os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true", - reason="This test requires local Wall-X installation and is not meant for CI", -) - from lerobot.policies.factory import make_policy_config # noqa: E402 from lerobot.policies.wall_x import WallXConfig # noqa: E402 from lerobot.policies.wall_x.modeling_wall_x import WallXPolicy # noqa: E402