-
-
Notifications
You must be signed in to change notification settings - Fork 73
138 lines (116 loc) · 5.29 KB
/
test_core.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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/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