-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (86 loc) · 4.67 KB
/
Copy pathci.yml
File metadata and controls
105 lines (86 loc) · 4.67 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# Cancel in-progress runs for the same branch on new pushes.
# Never cancel runs on main (every merge must be fully tested).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
# ────────────────────────────────────────────────────────────────────────────
# Lint — ruff (fastest possible feedback, runs in parallel with unit tests)
# ────────────────────────────────────────────────────────────────────────────
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dev dependencies
run: uv sync --frozen --group dev
- name: Ruff check
run: uv run ruff check .
# ────────────────────────────────────────────────────────────────────────────
# Unit tests — fast, no model download, runs in parallel with lint
# ────────────────────────────────────────────────────────────────────────────
unit:
name: Unit tests
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --frozen --extra cpu
- name: Run unit tests
run: uv run pytest tests/unit/ -v
# ────────────────────────────────────────────────────────────────────────────
# Integration tests — real inference, requires model weights
# Only runs after lint + unit both pass (fail fast)
# ────────────────────────────────────────────────────────────────────────────
integration:
name: Integration tests
runs-on: ubuntu-latest
needs: [unit]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --frozen --extra cpu
- name: Set model cache path
run: echo "VIZION3D_MODEL_CACHE=$HOME/.cache/vizion3d/models" >> "$GITHUB_ENV"
- name: Cache model weights
uses: actions/cache@v4
with:
path: ${{ env.VIZION3D_MODEL_CACHE }}
# Key is tied to the model filenames — bump if either model changes
key: depth-anything-v2-vitb-stereo-depth-s2m2-l-pth
- name: Show integration timing limits
env:
VIZION3D_TEST_DEPTH_COLD_LIMIT: ${{ vars.VIZION3D_TEST_DEPTH_COLD_LIMIT || vars.VIZION3D_TEST_COLD_LIMIT || '10' }}
VIZION3D_TEST_DEPTH_WARM_LIMIT: ${{ vars.VIZION3D_TEST_DEPTH_WARM_LIMIT || vars.VIZION3D_TEST_WARM_LIMIT || '1' }}
VIZION3D_TEST_STEREO_COLD_LIMIT: ${{ vars.VIZION3D_TEST_STEREO_COLD_LIMIT || '60' }}
VIZION3D_TEST_STEREO_WARM_LIMIT: ${{ vars.VIZION3D_TEST_STEREO_WARM_LIMIT || '5' }}
run: |
echo "VIZION3D_TEST_DEPTH_COLD_LIMIT=$VIZION3D_TEST_DEPTH_COLD_LIMIT"
echo "VIZION3D_TEST_DEPTH_WARM_LIMIT=$VIZION3D_TEST_DEPTH_WARM_LIMIT"
echo "VIZION3D_TEST_STEREO_COLD_LIMIT=$VIZION3D_TEST_STEREO_COLD_LIMIT"
echo "VIZION3D_TEST_STEREO_WARM_LIMIT=$VIZION3D_TEST_STEREO_WARM_LIMIT"
- name: Run integration tests
env:
VIZION3D_TEST_DEPTH_COLD_LIMIT: ${{ vars.VIZION3D_TEST_DEPTH_COLD_LIMIT || vars.VIZION3D_TEST_COLD_LIMIT || '10' }}
VIZION3D_TEST_DEPTH_WARM_LIMIT: ${{ vars.VIZION3D_TEST_DEPTH_WARM_LIMIT || vars.VIZION3D_TEST_WARM_LIMIT || '1' }}
VIZION3D_TEST_STEREO_COLD_LIMIT: ${{ vars.VIZION3D_TEST_STEREO_COLD_LIMIT || '60' }}
VIZION3D_TEST_STEREO_WARM_LIMIT: ${{ vars.VIZION3D_TEST_STEREO_WARM_LIMIT || '5' }}
run: uv run pytest tests/integration/ -v