Feat/ollama #68
Workflow file for this run
This file contains 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: 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-24.04" # Ubuntu x86_64 | |
args: '' | |
pre-build-args: "" | |
name: "Ubuntu 24.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" | |
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 mesa-vulkan-drivers | |
run: sudo apt-get update && sudo apt-get install -y mesa-vulkan-drivers | |
if: ${{ contains(matrix.platform, 'ubuntu') && contains(matrix.args, 'vulkan') }} | |
- 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: Prepare Vulkan SDK for Linux | |
run: | | |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc | |
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list | |
sudo apt update | |
sudo apt install vulkan-sdk -y | |
if: ${{ contains(matrix.args, 'vulkan') && contains(matrix.platform, 'ubuntu') }} | |
- 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 DLLs to path | |
if: contains(matrix.pre-build-args, 'openblas') | |
run: | | |
echo "$PWD/desktop/src-tauri/openblas/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 |