name: CI on: push: branches: ["main", "codex/**"] pull_request: env: MODEL_URL: https://github.com/thedavidweng/openkara-models/releases/download/model-v1.0.0/htdemucs.onnx MODEL_SHA256: 66eebc928e4a9f7e5b837605794f4db2b91748f163b0bcbc8f29a526ffe5607e jobs: verify: name: Verify (${{ matrix.name }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - name: macOS os: macos-14 - name: Windows os: windows-latest - name: Linux os: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v5 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 10.12.1 - name: Setup Node.js uses: actions/setup-node@v5 with: node-version: 20 cache: pnpm - name: Setup Rust uses: dtolnay/rust-toolchain@stable - name: Restore Rust cache uses: swatinem/rust-cache@v2 with: workspaces: ./src-tauri -> target - name: Install Linux build dependencies if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y \ build-essential \ curl \ file \ patchelf \ libasound2-dev \ libayatana-appindicator3-dev \ librsvg2-dev \ libssl-dev \ libwebkit2gtk-4.1-dev \ libxdo-dev \ wget - name: Install JavaScript dependencies run: pnpm install --frozen-lockfile - name: Download separation model (Unix) if: runner.os != 'Windows' shell: bash run: ./scripts/setup.sh - name: Download separation model (Windows) if: runner.os == 'Windows' shell: pwsh run: | $modelPath = Join-Path $env:GITHUB_WORKSPACE "src-tauri/models/htdemucs.onnx" $modelDir = Split-Path $modelPath New-Item -ItemType Directory -Force -Path $modelDir | Out-Null function Get-ModelSha256([string]$path) { return (Get-FileHash -Algorithm SHA256 $path).Hash.ToLowerInvariant() } if (Test-Path $modelPath) { if ((Get-ModelSha256 $modelPath) -eq $env:MODEL_SHA256) { Write-Host "Model already present and verified at $modelPath" exit 0 } Remove-Item $modelPath -Force } $tmpPath = "$modelPath.download" Invoke-WebRequest -Uri $env:MODEL_URL -OutFile $tmpPath $downloadedSha = Get-ModelSha256 $tmpPath if ($downloadedSha -ne $env:MODEL_SHA256) { Remove-Item $tmpPath -Force -ErrorAction SilentlyContinue throw "Downloaded model checksum mismatch. Expected $env:MODEL_SHA256 got $downloadedSha" } Move-Item -Force $tmpPath $modelPath - name: Lint frontend run: pnpm lint - name: Verify formatting run: pnpm format # ---- Windows cargo-test skip ---- # # WHY: pyke's prebuilt onnxruntime.lib (ort-sys 2.0.0-rc.12) is # compiled with DirectML baked in. Even though ORT itself is # statically linked, the build script emits: # # cargo:rustc-link-lib=DirectML (dynamic) # cargo:rustc-link-lib=D3D12 (dynamic) # cargo:rustc-link-lib=DXGI (dynamic) # cargo:rustc-link-lib=DXCore (dynamic) # # These create hard load-time DLL imports. Headless Windows Server # runners (2022 & 2025) lack a GPU-capable DirectX 12 stack, so the # process loader fails with STATUS_ENTRYPOINT_NOT_FOUND (0xc0000139) # before any test code runs. # # WHAT WAS TRIED (all failed): # 1. Staging DirectML.dll v1.15.4 from Microsoft.AI.DirectML NuGet # → The staged DLL needs newer D3D12 APIs than Server 2022 has. # 2. Pinning runner to windows-2022 # → Same D3D12 incompatibility; Server 2022's GPU stack is too old. # 3. Staging onnxruntime.dll from Microsoft.ML.OnnxRuntime.DirectML NuGet # → ORT is truly statically linked; the system WinML onnxruntime.dll # in System32 is not the issue. The NuGet's DirectML.dll is a # 0-byte stub, confirming it expects the system version. # 4. D3D12 Agility SDK (Microsoft.Direct3D.D3D12 NuGet, D3D12Core.dll) # → Requires the application to export D3D12SDKVersion and # D3D12SDKPath symbols; cannot be enabled externally. # 5. Adding deps/ to PATH as DLL search fallback # → DLLs were found but the entry-point mismatch is in the # system DirectX stack itself, not a search-order problem. # # The Tauri build step still validates that the code compiles and # links correctly on Windows. Full test coverage runs on macOS # and Linux. # # TO RE-ENABLE: switch ort to load-dynamic linking (avoids the # DirectML/D3D12 import table entries entirely) or wait for pyke # to ship a Windows build without DirectML as default. - name: Run Rust tests if: runner.os != 'Windows' working-directory: src-tauri run: cargo test -q - name: Validate Tauri build run: pnpm tauri build --debug --no-bundle --ci