forked from agentscope-ai/agentscope-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (71 loc) · 2.17 KB
/
unit_test_training_sandbox.yml
File metadata and controls
91 lines (71 loc) · 2.17 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
name: Unit Tests for Training 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' ]
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: Cleanup disk space before pulling images
run: |
echo "Before cleanup:"
df -h
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
docker system prune -af || true
docker volume prune -f || true
pip cache purge || true
rm -rf /tmp/* || true
echo "After cleanup:"
df -h
- name: Pull Docker images
run: |
DOCKER_IMAGES=(
"agentscope/runtime-sandbox-appworld: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: Run tests with coverage
run: |
coverage run -m pytest tests/sandbox/test_sandbox_appworld.py
- name: Generate coverage report
run: |
coverage report -m