rollback version #866
Workflow file for this run
This file contains hidden or 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: Unit Tests for Sandbox | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'dev' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'dev' | |
| jobs: | |
| test: | |
| if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'docs:')) }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| python-version: [ '3.10' ] | |
| env: | |
| RUNTIME_SANDBOX_TIMEOUT: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Attempt to load Android kernel modules | |
| run: | | |
| echo "1/4: Installing linux-modules-extra for kernel $(uname -r)..." | |
| sudo apt-get update -y && sudo apt-get install -y linux-modules-extra-$(uname -r) || echo "WARNING: apt-get install failed, but continuing." | |
| echo "2/4: Attempting to load binder_linux module..." | |
| sudo modprobe binder_linux devices="binder,hwbinder,vndbinder" || echo "INFO: modprobe binder_linux failed." | |
| echo "3/4: Attempting to load ashmem_linux module..." | |
| sudo modprobe ashmem_linux || echo "INFO: modprobe ashmem_linux failed as expected." | |
| echo "4/4: Checking loaded modules with lsmod..." | |
| lsmod | grep -E "binder|ashmem" || echo "INFO: No 'binder' or 'ashmem' modules found in lsmod output." | |
| - name: Pull Docker images | |
| run: | | |
| DOCKER_IMAGES=( | |
| "agentscope/runtime-sandbox-base:latest" | |
| "agentscope/runtime-sandbox-gui:latest" | |
| "agentscope/runtime-sandbox-browser:latest" | |
| "agentscope/runtime-sandbox-filesystem:latest" | |
| "agentscope/runtime-sandbox-mobile:latest" | |
| ) | |
| for img in "${DOCKER_IMAGES[@]}"; do | |
| echo "Pulling image: $img" | |
| docker pull "$img" | |
| done | |
| echo "All Docker images pulled successfully." | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Update setuptools | |
| run: | | |
| pip install --upgrade pip | |
| pip install setuptools==78.1.1 wheel==0.45.1 | |
| - name: Set PYTHONPATH | |
| run: | | |
| echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}/src" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: | | |
| export PIP_DEFAULT_TIMEOUT=300 | |
| pip install -q -e ".[dev]" | |
| - name: Show installed pip packages (versions) | |
| run: | | |
| python -m pip list --format=columns | |
| - name: Run tests with coverage (default) | |
| run: | | |
| coverage run -m pytest tests/sandbox/test_sandbox.py tests/sandbox/test_sandbox_service.py tests/sandbox/test_heartbeat.py tests/sandbox/test_heartbeat_timeout_restore.py | |
| - name: Generate coverage report | |
| run: | | |
| coverage report -m |