Skip to content
230 changes: 230 additions & 0 deletions .github/workflows/engines-cross-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
# Cross-platform lanes for the engines (parakeet-cpp/, tts-cpp/ — engines/*
# after the repo reorg QIP; update the path filters + SRC map when it lands).
#
# Complements parakeet-ci.yml / tts-ci.yml (linux+mac build+test):
# - windows: full build + non-GPU ctest (MSVC, static ggml)
# - android: compile smoke, arm64-v8a via NDK (no device to run tests on)
# - ios: compile smoke, arm64 device slice, Metal embedded (flags
# mirror build-xcframework.sh)
# On-device e2e stays downstream in tetherto/qvac; these lanes exist to
# catch cross-compile/link breaks *before* the registry pin chain.
name: engines cross CI

on:
push:
branches: [master]
paths:
- 'parakeet-cpp/**'
- 'tts-cpp/**'
- '.github/workflows/engines-cross-ci.yml'
pull_request:
paths:
- 'parakeet-cpp/**'
- 'tts-cpp/**'
- '.github/workflows/engines-cross-ci.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: engines-cross-ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GGML_REPO: https://github.com/tetherto/qvac-ext-ggml.git
GGML_BRANCH: speech # single ggml pin shared with parakeet-ci.yml / tts-ci.yml

jobs:
windows:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: parakeet-cpp
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=ON -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: tts-cpp
cmake_flags: -DTTS_CPP_BUILD_TESTS=ON
runs-on: windows-2022
timeout-minutes: 90
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-windows-2022-msvc-static-${{ steps.ggml.outputs.sha }}

# Static ggml on Windows sidesteps DLL discovery for the test exes.
- name: Build ggml (MSVC, static, CPU-only)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build -A x64 \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build --config Release -j4
cmake --install ggml-src/build --config Release

- name: Configure
run: |
cmake -S ${{ matrix.src }} -B build -A x64 \
${{ matrix.cmake_flags }} \
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"

- name: Build
run: cmake --build build --config Release -j4

- name: Test (non-GPU)
run: ctest --test-dir build -C Release -LE 'gpu|perf' --output-on-failure --timeout 600

android:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: parakeet-cpp
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=OFF -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: tts-cpp
cmake_flags: -DTTS_CPP_BUILD_TESTS=OFF
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-android-arm64-${{ steps.ggml.outputs.sha }}

- name: Build ggml (NDK arm64-v8a, static, CPU-only)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_OPENMP=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j4
cmake --install ggml-src/build

# Compile smoke only: hosted runners can't execute arm64 Android
# binaries. CMAKE_FIND_ROOT_PATH (not PREFIX_PATH) because the NDK
# toolchain restricts find_package() to the find-root.
- name: Configure + build engine (compile smoke)
run: |
cmake -S ${{ matrix.src }} -B build \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.cmake_flags }} \
-DCMAKE_FIND_ROOT_PATH="$PWD/ggml-install"
cmake --build build -j4

ios:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: parakeet-cpp
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=OFF -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: tts-cpp
cmake_flags: -DTTS_CPP_BUILD_TESTS=OFF
runs-on: macos-14
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-ios-arm64-${{ steps.ggml.outputs.sha }}

# Flags mirror build-xcframework.sh's iOS-device slice (Metal embedded).
- name: Build ggml (iOS device arm64, static, Metal embedded)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=16.4 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_METAL=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DGGML_METAL_USE_BF16=ON \
-DGGML_OPENMP=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j4
cmake --install ggml-src/build

# Compile smoke only (no iOS device on hosted runners).
- name: Configure + build engine (compile smoke)
run: |
cmake -S ${{ matrix.src }} -B build \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=16.4 \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.cmake_flags }} \
-DCMAKE_FIND_ROOT_PATH="$PWD/ggml-install"
cmake --build build -j4
146 changes: 146 additions & 0 deletions .github/workflows/parakeet-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# CI for the parakeet engine (parakeet-cpp/ — engines/parakeet/ after the
# repo reorg QIP lands; update the path filters below when it does).
#
# Scope (QIP "PR 0" lane): build the engine + every test harness against
# system ggml (qvac-ext-ggml @ speech, the same fork the ggml-speech vcpkg
# port ships), then run the non-GPU ctest suites. Tests whose model/reference
# fixtures aren't present are registered as DISABLED by the CMakeLists and
# show up as "Not Run" — the lane stays green with the committed fixtures
# only. GPU suites (`ctest -L gpu`) need real GPUs → self-hosted lane, see
# the gpu job stub at the bottom.
name: parakeet CI

on:
push:
branches: [master]
paths:
- 'parakeet-cpp/**'
- '.github/workflows/parakeet-ci.yml'
pull_request:
paths:
- 'parakeet-cpp/**'
- '.github/workflows/parakeet-ci.yml'
workflow_dispatch:
inputs:
run_gpu:
description: 'Also run the GPU ctest lane (needs a [self-hosted, gpu] runner)'
type: boolean
default: false

permissions:
contents: read

concurrency:
group: parakeet-ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GGML_REPO: https://github.com/tetherto/qvac-ext-ggml.git
GGML_BRANCH: speech # keep in sync with parakeet-cpp/scripts/setup-ggml.sh

jobs:
build-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Install ccache
run: |
if [ "$RUNNER_OS" = "macOS" ]; then brew install ccache; else sudo apt-get update -q && sudo apt-get install -y ccache; fi
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> "$GITHUB_ENV"

- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-${{ matrix.os }}-${{ steps.ggml.outputs.sha }}

- name: Cache ccache
uses: actions/cache@v4
with:
path: .ccache
key: ccache-parakeet-${{ matrix.os }}-${{ github.sha }}
restore-keys: ccache-parakeet-${{ matrix.os }}-

# CPU-only ggml: this lane runs `-LE gpu` tests, and hosted runners
# have no Vulkan/OpenCL; Metal is exercised by the gpu lane instead.
- name: Build ggml (system ggml, qvac-ext-ggml@${{ env.GGML_BRANCH }})
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from — the branch
# tip may have advanced since the ls-remote resolution, and a
# tip-only shallow clone would then silently build (and cache)
# a different commit than the key claims.
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGGML_METAL=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j4
cmake --install ggml-src/build

- name: Configure
run: |
cmake -S parakeet-cpp -B build \
-DCMAKE_BUILD_TYPE=Release \
-DPARAKEET_USE_SYSTEM_GGML=ON \
-DPARAKEET_BUILD_TESTS=ON \
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"

- name: Build
run: cmake --build build -j4

# Excludes gpu (no GPU on hosted runners) and perf (timing gates are
# meaningless on shared runners). Model-dependent tests are DISABLED
# at configure time when fixtures are absent and report as "Not Run".
# LD_LIBRARY_PATH: the ggml install ships libqvac-speech-ggml.so whose
# own dependency on the ggml-cpu/base siblings is resolved transitively
# — Linux RUNPATH doesn't apply to transitive loads, so the loader
# needs the directory explicitly (macOS @rpath chains handle it).
- name: Test (non-GPU)
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/ggml-install/lib
run: ctest --test-dir build -LE 'gpu|perf' --output-on-failure --timeout 600

# GPU lane stub: opt-in until self-hosted GPU runners exist. Trial note:
# hosted macos-14 exposes Metal, so moving `-L gpu` into the macOS
# build-test job is a cheap first experiment.
gpu:
if: github.event_name == 'workflow_dispatch' && inputs.run_gpu
runs-on: [self-hosted, gpu]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
# GGML_VULKAN=ON is the backend the -L gpu suites primarily target
# (test_vk_vs_cpu et al); Metal is on by default on Apple hosts.
# Revisit the flag set (OpenCL? CUDA?) when the GPU runner fleet is
# provisioned — a CPU-only ggml here would skip or falsely pass the
# GPU suites.
- name: Build ggml + engine (native backends) and run GPU suites
run: |
git clone --depth 1 --branch "$GGML_BRANCH" "$GGML_REPO" ggml-src
cmake -S ggml-src -B ggml-src/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \
-DGGML_VULKAN=ON \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j && cmake --install ggml-src/build
cmake -S parakeet-cpp -B build -DCMAKE_BUILD_TYPE=Release \
-DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=ON \
Comment thread
GustavoA1604 marked this conversation as resolved.
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"
cmake --build build -j
ctest --test-dir build -L gpu --output-on-failure --timeout 1200
Loading
Loading