-
-
Notifications
You must be signed in to change notification settings - Fork 183
194 lines (184 loc) · 7.03 KB
/
run-integration-tests.yaml
File metadata and controls
194 lines (184 loc) · 7.03 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: run-integration-tests
on:
pull_request:
jobs:
changes:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'audio_separator/**'
- 'tests/**'
- 'pyproject.toml'
- 'poetry.lock'
- '.github/workflows/run-integration-tests.yaml'
# ── Integration test jobs (parallel across 3 GPU runners) ──────────
#
# Balanced to ~7 min each so all 3 finish around the same time.
#
# ensemble-presets (~8 min): test_ensemble_integration (heaviest single file)
# core-models (~7 min): test_24bit + test_cli + test_separator_output + roformer tests
# stems-and-quality (~6 min): test_ensemble_meaningful + test_multi_stem + test_remote_api
ensemble-presets:
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: [self-hosted, gpu]
timeout-minutes: 15
env:
AUDIO_SEPARATOR_MODEL_DIR: /opt/audio-separator-models
steps:
- uses: actions/checkout@v4
- name: Verify GPU availability
run: nvidia-smi --query-gpu=driver_version,name,memory.total --format=csv,noheader
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install pipx and poetry
run: |
python -m pip install --user pipx && python -m pipx ensurepath
python -m pipx install poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libsamplerate0 libsamplerate-dev
- name: Set up Python with cache
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: poetry
- name: Install Poetry dependencies (GPU)
run: poetry install -E gpu
- name: Verify pre-cached models
run: |
MODEL_COUNT=$(ls -1 $AUDIO_SEPARATOR_MODEL_DIR | wc -l)
echo "Pre-cached models: $MODEL_COUNT"
if [ "$MODEL_COUNT" -lt 10 ]; then
echo "::warning::Expected at least 10 pre-cached model files, found $MODEL_COUNT"
fi
- name: "Run: ensemble preset tests (~8 min)"
run: poetry run pytest -sv tests/integration/test_ensemble_integration.py
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ensemble-presets-results
path: |
*.flac
tests/*.flac
core-models:
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: [self-hosted, gpu]
timeout-minutes: 15
env:
AUDIO_SEPARATOR_MODEL_DIR: /opt/audio-separator-models
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install pipx and poetry
run: |
python -m pip install --user pipx && python -m pipx ensurepath
python -m pipx install poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libsamplerate0 libsamplerate-dev
- name: Set up Python with cache
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: poetry
- name: Install Poetry dependencies (GPU)
run: poetry install -E gpu
- name: "Run: 24-bit, CLI, output, and roformer tests (~7 min)"
run: |
poetry run pytest -sv \
tests/integration/test_24bit_preservation.py \
tests/integration/test_cli_integration.py \
tests/integration/test_separator_output_integration.py \
tests/integration/test_roformer_audio_quality.py \
tests/integration/test_roformer_backward_compatibility.py \
tests/integration/test_roformer_config_validation.py \
tests/integration/test_roformer_e2e.py \
tests/integration/test_roformer_fallback_mechanism.py \
tests/integration/test_roformer_model_switching.py \
tests/integration/test_roformer_new_parameters.py
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: core-models-results
path: |
*.flac
tests/*.flac
stems-and-quality:
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: [self-hosted, gpu]
timeout-minutes: 15
env:
AUDIO_SEPARATOR_MODEL_DIR: /opt/audio-separator-models
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install pipx and poetry
run: |
python -m pip install --user pipx && python -m pipx ensurepath
python -m pipx install poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libsamplerate0 libsamplerate-dev
- name: Set up Python with cache
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: poetry
- name: Install Poetry dependencies (GPU)
run: poetry install -E gpu
- name: "Run: ensemble quality, multi-stem, and remote API tests (~6 min)"
run: |
poetry run pytest -sv \
tests/integration/test_ensemble_meaningful.py \
tests/integration/test_multi_stem_verification.py \
tests/integration/test_remote_api_integration.py
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: stems-and-quality-results
path: |
*.flac
tests/*.flac
# ── Gate job for branch protection ────────────────────────────────
integration-test:
needs: [changes, ensemble-presets, core-models, stems-and-quality]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check test results
run: |
if [[ "${{ needs.changes.outputs.should_run }}" != "true" ]]; then
echo "Tests skipped - no code changes detected"
exit 0
fi
echo "ensemble-presets: ${{ needs.ensemble-presets.result }}"
echo "core-models: ${{ needs.core-models.result }}"
echo "stems-and-quality: ${{ needs.stems-and-quality.result }}"
if [[ "${{ needs.ensemble-presets.result }}" == "failure" ]] || \
[[ "${{ needs.core-models.result }}" == "failure" ]] || \
[[ "${{ needs.stems-and-quality.result }}" == "failure" ]]; then
echo "Integration tests failed"
exit 1
fi
echo "All integration tests passed"