Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build

on:
pull_request:
paths:
- cactus/**
- cactus-engine/**
- cactus-graph/**
- cactus-kernels/**
- apple/**
- android/**
- .github/workflows/build.yml
push:
branches: [main]
paths:
- cactus/**
- cactus-engine/**
- cactus-graph/**
- cactus-kernels/**
- apple/**
- android/**
- .github/workflows/build.yml
workflow_dispatch:

permissions:
contents: read

jobs:
apple:
runs-on: macos-15
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- run: bash cactus/build.sh
- run: BUILD_STATIC=true BUILD_XCFRAMEWORK=false bash apple/build.sh
- run: bash android/build.sh

linux:
runs-on: ubuntu-24.04-arm
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y cmake build-essential libcurl4-openssl-dev
- run: bash cactus/build.sh
52 changes: 0 additions & 52 deletions .github/workflows/cpp.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
- bindings/flutter/README.md
- bindings/rust/README.md
- README.md
workflow_call:
inputs:
version:
type: string
required: false
workflow_dispatch:

jobs:
Expand All @@ -40,9 +45,11 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
TAG=$(cat CACTUS_VERSION | tr -d '[:space:]')
TAG="${{ inputs.version || '' }}"
[ -z "$TAG" ] && TAG=$(cat CACTUS_VERSION | tr -d '[:space:]')
bash .github/assemble-docs.sh "$TAG"
mike deploy "$TAG" latest --update-aliases --push
mike set-default latest --push

git checkout gh-pages
echo "docs.cactuscompute.com" > CNAME
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/inference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Inference Tests

on:
pull_request_review:
types: [submitted]
workflow_dispatch:

permissions:
contents: read

jobs:
gate:
runs-on: ubuntu-latest
outputs:
approved: ${{ steps.check.outputs.approved }}
steps:
- id: check
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "approved=true" >> $GITHUB_OUTPUT
elif [ "${{ github.event.review.state }}" = "approved" ]; then
echo "approved=true" >> $GITHUB_OUTPUT
else
echo "approved=false" >> $GITHUB_OUTPUT
fi

build:
needs: gate
if: needs.gate.outputs.approved == 'true'
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v4
with:
clean: false

- name: Setup Python environment
run: |
if [ ! -f venv/bin/activate ]; then
source ./setup
fi

- name: Convert models
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source venv/bin/activate
convert() {
local id=$1 dir=$2 bits=$3
[ -f "weights/$dir/config.txt" ] && return
python3 -m cactus convert "$id" --bits "$bits" ${HF_TOKEN:+--token "$HF_TOKEN"} || true
}
convert "Qwen/Qwen3-0.6B" "qwen3-0.6b" "4"
convert "google/gemma-3-270m-it" "gemma-3-270m-it" "4"
convert "openai/whisper-small" "whisper-small" "4"
convert "nvidia/parakeet-tdt-0.6b-v3" "parakeet-tdt-0.6b-v3" "4"

- name: Build
run: |
bash cactus/build.sh
cd cactus-engine/tests
rm -rf build && mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

unit-tests:
needs: build
runs-on: [self-hosted, linux, arm64]
env:
CACTUS_INDEX_PATH: /tmp/cactus_test_index
CACTUS_NO_CLOUD_TELE: "1"
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run unit tests
run: |
mkdir -p "$CACTUS_INDEX_PATH"
cd cactus-engine/tests/build
./test_index
./test_model_loading
./test_telemetry

- name: Run kernel tests
run: bash cactus-kernels/test.sh

- name: Run graph tests
run: bash cactus-graph/test.sh

inference-tests:
needs: build
runs-on: [self-hosted, linux, arm64]
env:
CACTUS_TEST_ASSETS: ${{ github.workspace }}/cactus-engine/tests/assets
CACTUS_NO_CLOUD_TELE: "1"
strategy:
fail-fast: false
matrix:
include:
- test: test_llm
model_dir: qwen3-0.6b
- test: test_llm
model_dir: gemma-3-270m-it
- test: test_stt
model_dir: whisper-small
- test: test_stt
model_dir: parakeet-tdt-0.6b-v3
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run ${{ matrix.test }} (${{ matrix.model_dir }})
env:
CACTUS_TEST_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
CACTUS_TEST_TRANSCRIBE_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
run: ./cactus-engine/tests/build/${{ matrix.test }}
83 changes: 83 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: PyPI Publish

on:
workflow_call:

jobs:
wheels:
strategy:
matrix:
include:
- os: macos-14
lib: libcactus.dylib
plat: macosx_14_0_arm64
- os: ubuntu-24.04-arm
lib: libcactus.so
plat: manylinux_2_17_aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Install build tools
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update && sudo apt-get install -y cmake build-essential libcurl4-openssl-dev
fi

- name: Build libcactus
run: bash cactus/build.sh

- name: Bundle library into package
run: |
mkdir -p python/cactus/bindings/lib
cp cactus/build/${{ matrix.lib }} python/cactus/bindings/lib/

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build wheel
run: |
pip install build wheel
cd python
python -m build --wheel -C="--build-option=--plat-name=${{ matrix.plat }}"

- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: python/dist/*.whl

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build sdist
run: |
pip install build
cd python
python -m build --sdist

- uses: actions/upload-artifact@v4
with:
name: sdist
path: python/dist/*.tar.gz

publish:
needs: [wheels, sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
36 changes: 36 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Python Tests

on:
pull_request:
paths:
- "python/**"
- ".github/workflows/python.yml"
push:
branches: [main]
paths:
- "python/**"
- ".github/workflows/python.yml"

jobs:
test:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y cmake build-essential libcurl4-openssl-dev

- name: Build libcactus
run: bash cactus/build.sh

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: pip install -e "python/[dev]"

- name: Run tests
run: |
cd python
pytest tests/ -v --ignore=tests/test_model.py
Loading
Loading