name: run-integration-tests on: pull_request: jobs: integration-test: runs-on: self-hosted env: AUDIO_SEPARATOR_MODEL_DIR: ${{ github.workspace }}/models steps: - name: Checkout project uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.13' - name: Install pipx run: python -m pip install --user pipx && python -m pipx ensurepath - name: Install poetry run: python -m pipx install poetry - name: Setup PATH run: echo "/root/.local/bin" >> $GITHUB_PATH - name: Install system dependencies run: | apt-get update apt-get install -y ffmpeg libsamplerate0 libsamplerate-dev - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.13' cache: poetry - name: Create models directory run: mkdir -p $AUDIO_SEPARATOR_MODEL_DIR - name: Cache models directory uses: actions/cache@v3 id: model-cache with: path: ${{ env.AUDIO_SEPARATOR_MODEL_DIR }} key: model-cache-${{ hashFiles('tests/integration/test_cli_integration.py') }} restore-keys: model-cache- - name: Install Poetry dependencies run: poetry install -E cpu - name: Display model cache status run: | echo "Model cache hit: ${{ steps.model-cache.outputs.cache-hit == 'true' }}" echo "Models directory contents:" ls -la $AUDIO_SEPARATOR_MODEL_DIR || echo "Directory empty or doesn't exist" - name: Run integration tests run: poetry run pytest -sv --cov=audio_separator --cov-report=xml tests/integration - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results if: always() uses: actions/upload-artifact@v4 with: name: integration-test-results path: | *.flac tests/*.flac **/temp_images/**/*.png tests/**/temp_images/**/*.png