-
Notifications
You must be signed in to change notification settings - Fork 10
87 lines (74 loc) · 2.77 KB
/
cpu_tests.yml
File metadata and controls
87 lines (74 loc) · 2.77 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
name: CPU-only Unit Tests (agents)
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test-envs:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.12"]
test-file:
- tests/unit/envs/ --ignore tests/unit/envs/test_webshop_text_env.py --ignore tests/unit/envs/test_alfworld_env.py --ignore tests/unit/envs/test_chess_env.py
- tests/unit/envs/test_alfworld_env.py
# - tests/unit/envs/test_webshop_text_env.py # TODO: add minimal variant of the webshop docker image
- tests/unit/rewards/ --ignore tests/unit/rewards/test_env_id.py --ignore tests/unit/rewards/test_webshop_reward.py
- tests/unit/tools/ --ignore tests/unit/tools/test_webshop_tool.py --ignore tests/unit/tools/test_scienceworld_tool.py --ignore tests/unit/tools/test_code_tool.py
- tests/unit/tools/test_scienceworld_tool.py
- tests/unit/tools/test_code_tool.py
# - test/unit/agents/ # TODO: recheck this
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Verify Python
run: |
which python
python --version
which pip
python -m pip --version
- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker system prune -af || true
echo "After cleanup:"
df -h
- name: Install dependencies (main repo)
run: |
pip install -e .
pip install datasets
pip install -e '.[dev]' --no-build-isolation
- name: Cache AgentFly cache
uses: actions/cache@v4
with:
path: ~/.cache/AgentFly
key: ${{ runner.os }}-agentfly-cache
restore-keys: |
${{ runner.os }}-agentfly-cache
- name: Install enroot
run: |
mkdir -p ~/enroot-packages
cd ~/enroot-packages
arch=$(dpkg --print-architecture)
if [ ! -f enroot_3.5.0-1_${arch}.deb ]; then
curl -fSsL -O https://github.com/NVIDIA/enroot/releases/download/v3.5.0/enroot_3.5.0-1_${arch}.deb
curl -fSsL -O https://github.com/NVIDIA/enroot/releases/download/v3.5.0/enroot+caps_3.5.0-1_${arch}.deb
fi
sudo apt-get update
sudo apt-get install -y ./*.deb
- name: Run unit test (${{ matrix.test-file }})
run: |
pytest ${{ matrix.test-file }}