Skip to content

Merge pull request #24 from augmem/fix/sqlite-objstore-win32-vla #183

Merge pull request #24 from augmem/fix/sqlite-objstore-win32-vla

Merge pull request #24 from augmem/fix/sqlite-objstore-win32-vla #183

Workflow file for this run

name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
ubuntu-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential pkg-config libsqlite3-dev
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCORTEXT_EMBED_AIST_MODEL=OFF -DCORTEXT_FETCH_AIST_MODEL=OFF -DCORTEXT_DISABLE_OPENTELEMETRY=ON -DCORTEXT_EXPERIMENT_HOOKS=ON
- name: Build
run: cmake --build build -j8
- name: Test
run: ./build/tests/cortext_tests '~[aist]' --reporter compact
arch-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and test on Arch Linux
run: |
docker run --rm -v "$PWD:/workspace" -w /workspace archlinux:base-devel bash -lc '
pacman -Syu --noconfirm cmake make gcc pkgconf sqlite git
git config --global --add safe.directory /workspace
cmake -S . -B build-arch -DCMAKE_BUILD_TYPE=Release -DCORTEXT_EMBED_AIST_MODEL=OFF -DCORTEXT_FETCH_AIST_MODEL=OFF -DCORTEXT_DISABLE_OPENTELEMETRY=ON -DCORTEXT_EXPERIMENT_HOOKS=ON
cmake --build build-arch -j"$(nproc)"
./build-arch/tests/cortext_tests "~[aist]" --reporter compact
'
ubuntu-aist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential pkg-config libsqlite3-dev
- name: Cache AIST q8_0 model
uses: actions/cache@v4
with:
path: |
models/AIST-87M-GGUF/AIST-87M_q8_0.gguf
models/mdbr-leaf-ir/vocab.txt
key: aist-q8_0-bf4c49954eccc65183f1a97e44606e86c7ee5a4fea500457124b687a3ec97898-bert-vocab-07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3
- name: Ensure AIST q8_0 model
run: python3 scripts/download_aist_model.py --output-dir models --quant q8_0
- name: Configure CMake
run: cmake -S . -B build-aist -DCMAKE_BUILD_TYPE=Release -DCORTEXT_EMBED_AIST_MODEL=ON -DCORTEXT_FETCH_AIST_MODEL=OFF -DCORTEXT_DISABLE_OPENTELEMETRY=ON -DCORTEXT_EXPERIMENT_HOOKS=ON
- name: Build
run: cmake --build build-aist -j8
- name: Test AIST
run: ./build-aist/tests/cortext_tests '[aist]' --reporter compact
ubuntu-sanitizers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential pkg-config libsqlite3-dev
- name: Configure CMake
run: cmake -S . -B build-sanitizers -DCMAKE_BUILD_TYPE=Debug -DCORTEXT_EMBED_AIST_MODEL=OFF -DCORTEXT_FETCH_AIST_MODEL=OFF -DCORTEXT_DISABLE_OPENTELEMETRY=ON -DCORTEXT_EXPERIMENT_HOOKS=ON -DCORTEXT_ENABLE_ASAN=ON -DCORTEXT_ENABLE_UBSAN=ON
- name: Build
run: cmake --build build-sanitizers -j8
- name: Test
env:
ASAN_OPTIONS: detect_leaks=0
run: ./build-sanitizers/tests/cortext_tests '~[aist]' --reporter compact
wasm-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.74
- name: Build browser WebAssembly bundle
run: ./build-wasm.sh
- name: Check browser artifacts
run: |
test -s build-wasm/dist/wasm/cortext.js
test -s build-wasm/dist/wasm/cortext.wasm
zig-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Install host dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
- name: Fetch Zig dependencies
run: zig build --fetch -Dshared=true -Dembed-aist-model=false
- name: Build Zig host FFI library
run: zig build -Dshared=true -Dembed-aist-model=false
- name: Cross-build Zig FFI library
run: zig build -Dtarget=x86_64-linux-gnu -Dshared=true -Dembed-aist-model=false
zig-cli-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: cortext_cli
- os: windows-latest
artifact: cortext_cli.exe
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build installable Zig CLI
shell: bash
run: zig build -Doptimize=ReleaseFast -Dshared=false -Dcli=true -Dembed-aist-model=false -Dfetch-aist-model=false
- name: Check installed CLI artifact
shell: bash
run: |
if [[ "${RUNNER_OS}" == "Windows" ]]; then
test -s "zig-out/bin/${{ matrix.artifact }}"
else
test -x "zig-out/bin/${{ matrix.artifact }}"
fi
zig-cli-targets:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-linux-gnu
artifact: cortext_cli
- target: x86_64-windows-gnu
artifact: cortext_cli.exe
- target: x86_64-macos
artifact: cortext_cli
- target: aarch64-macos
artifact: cortext_cli
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build Zig CLI target artifact
shell: bash
run: |
zig build \
-Dtarget=${{ matrix.target }} \
-Doptimize=ReleaseFast \
-Dshared=false \
-Dcli=true \
-Dembed-aist-model=false \
-Dfetch-aist-model=false
- name: Check target CLI artifact
shell: bash
run: test -s "zig-out/bin/${{ matrix.artifact }}"