Skip to content

Test Core

Test Core #28

Workflow file for this run

name: Test Core
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/lint.yml'
- 'desktop/src-tauri/**'
- 'cli/src/**'
- 'core/src/**'
jobs:
test:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
pre-build-args: ""
name: "MacOS (Arm) - aarch64"
action: "test"
- platform: "macos-13" # for Intel based macs.
args: "--target x86_64-apple-darwin"
pre-build-args: ""
name: "MacOS (Intel) - x86_64"
action: "test"
- platform: "ubuntu-22.04" # Ubuntu x86_64
args: ""
pre-build-args: ""
name: "Ubuntu 22.04 - x86_64"
action: "test"
- platform: "windows-latest" # Windows x86_64
args: "--target x86_64-pc-windows-msvc"
pre-build-args: ""
name: "Windows - x86_64"
action: "test"
- platform: "windows-latest" # Windows x86_64 with openblas
args: '--target x86_64-pc-windows-msvc --features "openblas"'
pre-build-args: "--openblas"
name: "Windows - x86_64 with OpenBLAS"
action: "test"
- platform: "windows-latest" # Windows x86_64 with opencl
args: '--target x86_64-pc-windows-msvc --features "opencl"'
pre-build-args: "--opencl"
name: "Windows - x86_64 with OpenCL"
action: "test"
- platform: "ubuntu-22.04"
args: '--features "rocm"'
rocm-version: "6.1.2"
pre-build-args: "--rocm"
name: "Ubuntu 22.04 - ROCM"
action: "build"
runs-on: ${{ matrix.platform }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu) for Rocm
if: contains(matrix.args, 'rocm')
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Install rocm
if: contains(matrix.args, 'rocm')
run: |
wget https://repo.radeon.com/amdgpu-install/${{ matrix.rocm-version }}/ubuntu/jammy/amdgpu-install_6.1.60102-1_all.deb
sudo apt install -y ./amdgpu-install_6.1.60102-1_all.deb
sudo apt update
sudo apt install -y rocm
- name: setup Bun
uses: oven-sh/setup-bun@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Cache Pre Build
id: cache-pre-build
uses: actions/cache@v4
with:
path: |
desktop/src-tauri/openblas
desktop/src-tauri/clblast
desktop/src-tauri/ffmpeg
key: ${{ matrix.platform }}-pre-build
# Run pre build
- name: Run pre_build.js on ${{ matrix.platform }}
run: bun scripts/pre_build.js ${{ matrix.pre-build-args }}
- name: Download tiny model on Windows
if: contains(matrix.platform, 'windows')
run: |
C:\msys64\usr\bin\wget.exe https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin
- name: Download tiny model on Linux
if: contains(matrix.platform, 'windows') == false
run: |
wget https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin
- name: Add ffmpeg to path
run: echo "$PWD/desktop/src-tauri/ffmpeg/bin" >> $GITHUB_PATH
if: contains(matrix.platform, 'windows') == false
- name: Add openblas and opencl DLLs to path
if: contains(matrix.pre-build-args, 'openblas') || contains(matrix.pre-build-args, 'opencl')
run: |
echo "$PWD/desktop/src-tauri/clblast/bin" >> $env:GITHUB_PATH
echo "$PWD/desktop/src-tauri/openblas/bin" >> $env:GITHUB_PATH
echo "C:/vcpkg/packages/opencl_x64-windows/bin" >> $env:GITHUB_PATH
- name: Build
if: matrix.action == 'build'
run: |
cargo build ${{ matrix.args }} -p vibe_core --release
- name: Test
if: matrix.action == 'test'
run: |
cargo test ${{ matrix.args }} -p vibe_core --release -- --nocapture
continue-on-error: ${{ contains(matrix.args, 'opencl') }} # OpenCL fail. need to check with whisper.cpp author