fix(sys): link advapi32 on Windows (ggml-cpu registry CPU detection) #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: build-${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS: Metal backend is auto-enabled by build.rs on target_os=macos. | |
| - os: macos-latest | |
| features: "" | |
| # Linux + Windows: GPU support via the Vulkan backend (ggml-vulkan). | |
| # Compile-only here (GPU-less runners) — shaders are compiled to SPIR-V | |
| # via glslc at build time; no VkInstance is created. | |
| - os: ubuntu-latest | |
| features: "--features vulkan" | |
| - os: windows-latest | |
| features: "--features vulkan" | |
| env: | |
| # Pin a known-good LunarG SDK version for Windows (see llama.cpp CI). | |
| VULKAN_VERSION: "1.4.313.2" | |
| steps: | |
| - name: Checkout (with vendored parakeet.cpp + ggml submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # ggml-vulkan's CMake requires: the Vulkan loader+headers (find_package | |
| # Vulkan), the `glslc` SPIR-V compiler component, and SPIRV-Headers. | |
| - name: Install Vulkan build deps (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y glslc libvulkan-dev spirv-headers cmake ninja-build build-essential | |
| - name: Install Vulkan SDK (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| curl.exe -o "$env:RUNNER_TEMP\VulkanSDK.exe" -L "https://sdk.lunarg.com/sdk/download/$env:VULKAN_VERSION/windows/vulkansdk-windows-X64-$env:VULKAN_VERSION.exe" | |
| & "$env:RUNNER_TEMP\VulkanSDK.exe" --accept-licenses --default-answer --confirm-command install | |
| Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\$env:VULKAN_VERSION" | |
| Add-Content $env:GITHUB_PATH "C:\VulkanSDK\$env:VULKAN_VERSION\bin" | |
| # ggml-vulkan builds with the Ninja generator on Windows (see build.rs); | |
| # Ninja needs an MSVC dev environment (cl.exe on PATH) + ninja itself. | |
| - name: Setup MSVC dev environment (Windows) | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install Ninja (Windows) | |
| if: runner.os == 'Windows' | |
| run: choco install ninja | |
| shell: pwsh | |
| # Windows MAX_PATH (260): the deeply nested cargo target + ggml-vulkan | |
| # ExternalProject + cmake TryCompile paths overflow it (C1041 "cannot open | |
| # program database"). A short CARGO_TARGET_DIR keeps paths under the limit. | |
| - name: Use a short target dir (Windows, avoid MAX_PATH) | |
| if: runner.os == 'Windows' | |
| run: echo "CARGO_TARGET_DIR=C:\b" >> $env:GITHUB_ENV | |
| shell: pwsh | |
| # rust-toolchain.toml pins the channel; rustup on the runner honors it. | |
| - name: Cargo build (release) | |
| run: cargo build --release -p parakeet-cpp ${{ matrix.features }} | |
| # Non-gated tests (pure logic + ABI smoke). Model-dependent integration | |
| # tests skip without PARAKEET_TEST_* env, so this is GPU-less safe. | |
| - name: Cargo test | |
| run: cargo test --release -p parakeet-cpp -p parakeet-cpp-sys ${{ matrix.features }} |