forked from alibaba/ROCK
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.68 KB
/
python-ci.yml
File metadata and controls
62 lines (50 loc) · 1.68 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
name: Python CI
on:
push:
branches:
- master
- release/v1.0
pull_request:
branches:
- master
- release/v1.0
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Cleanup old files in /tmp/ray
run: |
target="$(readlink -f /tmp/ray 2>/dev/null || echo /tmp/ray)"
[ -d "$target" ] || exit 0
echo "ray dir: $target"
echo "Before:"
du -sh "$target" 2>/dev/null || true
echo "Will delete (older than 60min):"
find "$target" -mindepth 1 -maxdepth 1 -type d -name 'session_*' -mmin +60 -print -exec du -sh {} \; || true
find "$target" -mindepth 1 -maxdepth 1 -type d -name 'session_*' -mmin +60 -exec rm -rf -- {} + || true
echo "After:"
du -sh "$target" 2>/dev/null || true
- name: Set up project (install dependencies without building)
run: |
uv sync --all-extras --group test --python 3.11
- name: Run fast tests
run: |
mkdir -p data/logs
echo "🚀 Running fast tests..."
uv run pytest -n auto -m "not need_ray and not need_admin and not need_admin_and_network" --reruns 1
- name: Run tests need ray
if: success()
run: |
echo "⚡ Running ray tests..."
uv run pytest -n auto -m "need_ray" --reruns 1
- name: Run tests need admin
if: success()
run: |
echo "🔐 Running admin tests..."
uv run pytest -n auto -m "need_admin" --reruns 1
- name: Run tests need admin and network
if: success()
run: |
echo "🔐 Running admin and network tests..."
uv run pytest -n auto -m "need_admin_and_network" --reruns 1