Skip to content

Commit 84e0dfc

Browse files
committed
General tests (#695)
* remove tests * cleanup cactus dir * fixes * cleanups * cleanup bindings * blog * docs * cactus-kernels * cactus-graph * cactus-engine * python * fixes * alginment Signed-off-by: jakmro <kubamroz124@gmail.com> Signed-off-by: Jakub Mroz <115979017+jakmro@users.noreply.github.com>
1 parent ccf15ee commit 84e0dfc

288 files changed

Lines changed: 3973 additions & 101775 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build
33
on:
44
pull_request:
55
paths:
6-
- cactus/**
76
- cactus-engine/**
87
- cactus-graph/**
98
- cactus-kernels/**
@@ -13,7 +12,6 @@ on:
1312
push:
1413
branches: [main]
1514
paths:
16-
- cactus/**
1715
- cactus-engine/**
1816
- cactus-graph/**
1917
- cactus-kernels/**
@@ -25,13 +23,17 @@ on:
2523
permissions:
2624
contents: read
2725

26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
2830
jobs:
2931
apple:
3032
runs-on: macos-15
31-
timeout-minutes: 15
33+
timeout-minutes: 30
3234
steps:
3335
- uses: actions/checkout@v4
34-
- run: bash cactus/build.sh
36+
- run: bash cactus-engine/build.sh
3537
- run: BUILD_STATIC=true BUILD_XCFRAMEWORK=false bash apple/build.sh
3638
- run: bash android/build.sh
3739

@@ -41,4 +43,4 @@ jobs:
4143
steps:
4244
- uses: actions/checkout@v4
4345
- run: sudo apt-get update && sudo apt-get install -y cmake build-essential libcurl4-openssl-dev
44-
- run: bash cactus/build.sh
46+
- run: bash cactus-engine/build.sh

.github/workflows/cpp.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1+
name: Unit Tests
2+
13
on:
24
pull_request:
35
paths:
4-
- cactus/**
5-
- tests/**
6+
- cactus-kernels/**
7+
- cactus-graph/**
68
- .github/workflows/cpp.yml
79
push:
810
branches: [main]
911
paths:
10-
- cactus/**
11-
- tests/**
12+
- cactus-kernels/**
13+
- cactus-graph/**
1214
- .github/workflows/cpp.yml
1315
workflow_dispatch:
1416

1517
permissions:
1618
contents: read
1719

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
1824
jobs:
19-
test:
20-
timeout-minutes: 45
25+
unit-tests:
26+
timeout-minutes: 30
2127
strategy:
2228
fail-fast: false
2329
matrix:
@@ -30,17 +36,7 @@ jobs:
3036
steps:
3137
- uses: actions/checkout@v4
3238
- run: ${{ matrix.deps }}
33-
- uses: actions/cache@v4
34-
with:
35-
path: ~/.ccache
36-
key: ccache-${{ matrix.os }}-${{ github.ref_name }}-${{ hashFiles('cactus/CMakeLists.txt', 'tests/CMakeLists.txt', '.github/workflows/cpp.yml') }}
37-
restore-keys: |
38-
ccache-${{ matrix.os }}-${{ github.ref_name }}-
39-
ccache-${{ matrix.os }}-
40-
- run: ccache --zero-stats || true
41-
- run: cmake -G Ninja -S cactus -B cactus/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
42-
- run: cmake --build cactus/build --target cactus_ffi --parallel 4
43-
- run: cmake -G Ninja -S tests -B tests/build-ci -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
44-
- run: cmake --build tests/build-ci --target test_stt --parallel 4
45-
- run: ./tests/build-ci/test_stt
46-
- run: ccache --show-stats || true
39+
- name: Run kernel tests
40+
run: bash cactus-kernels/test.sh
41+
- name: Run graph tests
42+
run: bash cactus-graph/test.sh

.github/workflows/dco.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: dco-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
714
jobs:
815
dco-check:
916
runs-on: ubuntu-latest
17+
timeout-minutes: 5
1018
name: DCO Check
1119
steps:
1220
- name: Checkout

.github/workflows/docs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ on:
2828
required: false
2929
workflow_dispatch:
3030

31+
permissions:
32+
contents: read
33+
34+
concurrency:
35+
group: docs-${{ github.ref }}
36+
cancel-in-progress: false
37+
3138
jobs:
3239
deploy:
3340
runs-on: ubuntu-latest
41+
timeout-minutes: 15
3442
permissions:
3543
contents: write
3644
steps:
@@ -41,7 +49,7 @@ jobs:
4149

4250
- uses: actions/setup-python@v5
4351
with:
44-
python-version: "3.x"
52+
python-version: "3.12"
4553

4654
- name: Install dependencies
4755
run: pip install "mkdocs==1.6.1" "mkdocs-material==9.7.5" "mike==2.1.4"

.github/workflows/inference.yml

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ on:
88
permissions:
99
contents: read
1010

11+
concurrency:
12+
group: inference-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
gate:
1317
runs-on: ubuntu-latest
18+
timeout-minutes: 5
1419
outputs:
1520
approved: ${{ steps.check.outputs.approved }}
1621
steps:
@@ -28,6 +33,7 @@ jobs:
2833
needs: gate
2934
if: needs.gate.outputs.approved == 'true'
3035
runs-on: [self-hosted, linux, arm64]
36+
timeout-minutes: 60
3137
steps:
3238
- uses: actions/checkout@v4
3339
with:
@@ -39,77 +45,35 @@ jobs:
3945
source ./setup
4046
fi
4147
42-
- name: Convert models
43-
env:
44-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
45-
run: |
46-
source venv/bin/activate
47-
convert() {
48-
local id=$1 dir=$2 bits=$3
49-
[ -f "weights/$dir/config.txt" ] && return
50-
python3 -m cactus convert "$id" --bits "$bits" ${HF_TOKEN:+--token "$HF_TOKEN"} || true
51-
}
52-
convert "Qwen/Qwen3-0.6B" "qwen3-0.6b" "4"
53-
convert "google/gemma-3-270m-it" "gemma-3-270m-it" "4"
54-
convert "openai/whisper-small" "whisper-small" "4"
55-
convert "nvidia/parakeet-tdt-0.6b-v3" "parakeet-tdt-0.6b-v3" "4"
56-
57-
- name: Build
48+
- name: Build libcactus + engine tests
5849
run: |
59-
bash cactus/build.sh
50+
bash cactus-engine/build.sh
6051
cd cactus-engine/tests
6152
rm -rf build && mkdir -p build && cd build
6253
cmake .. -DCMAKE_BUILD_TYPE=Release
6354
make -j$(nproc)
6455
65-
unit-tests:
66-
needs: build
67-
runs-on: [self-hosted, linux, arm64]
68-
env:
69-
CACTUS_INDEX_PATH: /tmp/cactus_test_index
70-
CACTUS_NO_CLOUD_TELE: "1"
71-
steps:
72-
- uses: actions/checkout@v4
73-
with:
74-
clean: false
75-
- name: Run unit tests
76-
run: |
77-
mkdir -p "$CACTUS_INDEX_PATH"
78-
cd cactus-engine/tests/build
79-
./test_index
80-
./test_model_loading
81-
./test_telemetry
82-
83-
- name: Run kernel tests
84-
run: bash cactus-kernels/test.sh
85-
86-
- name: Run graph tests
87-
run: bash cactus-graph/test.sh
88-
89-
inference-tests:
56+
model-tests:
9057
needs: build
9158
runs-on: [self-hosted, linux, arm64]
59+
timeout-minutes: 60
9260
env:
93-
CACTUS_TEST_ASSETS: ${{ github.workspace }}/cactus-engine/tests/assets
9461
CACTUS_NO_CLOUD_TELE: "1"
9562
strategy:
9663
fail-fast: false
9764
matrix:
98-
include:
99-
- test: test_llm
100-
model_dir: qwen3-0.6b
101-
- test: test_llm
102-
model_dir: gemma-3-270m-it
103-
- test: test_stt
104-
model_dir: whisper-small
105-
- test: test_stt
106-
model_dir: parakeet-tdt-0.6b-v3
65+
model:
66+
- LiquidAI/LFM2-VL-450M
67+
- openai/whisper-small
10768
steps:
10869
- uses: actions/checkout@v4
10970
with:
11071
clean: false
111-
- name: Run ${{ matrix.test }} (${{ matrix.model_dir }})
72+
73+
- name: Run tests for ${{ matrix.model }}
11274
env:
113-
CACTUS_TEST_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
114-
CACTUS_TEST_TRANSCRIBE_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
115-
run: ./cactus-engine/tests/build/${{ matrix.test }}
75+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
76+
run: |
77+
source venv/bin/activate
78+
MODEL="${{ github.event.inputs.model || matrix.model }}"
79+
python3 -m cactus test --component engine --model "$MODEL"

0 commit comments

Comments
 (0)