Skip to content

v0.1.1-alpha.22

v0.1.1-alpha.22 #165

Workflow file for this run

name: "test build"
on:
push:
branches:
- main
permissions:
contents: read
env:
ARTIFACT-LINUX-X86_64-EXTENSION: sqlite-vss-linux-x86_64
ARTIFACT-MACOS-X86_64-EXTENSION: sqlite-vss-macos-x86_64
ARTIFACT-MACOS-AARCH64-EXTENSION: sqlite-vss-macos-aarch64
ARTIFACT-WINDOWS-X86_64-EXTENSION: sqlite-vss-windows-x86_64
ARTIFACT-LINUX-X86_64-WHEELS: sqlite-vss-linux-x86_64-wheels
ARTIFACT-MACOS-X86_64-WHEELS: sqlite-vss-macos-x86_64-wheels
ARTIFACT-MACOS-AARCH64-WHEELS: sqlite-vss-macos-aarch64-wheels
jobs:
build-linux-x86_64-extension:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache sqlite build
id: cache-sqlite-build
uses: actions/cache@v3
with:
path: vendor/sqlite
key: ${{ runner.os }}-${{ hashFiles('vendor/get_sqlite.sh') }}
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
run: ./vendor/get_sqlite.sh
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
working-directory: vendor/sqlite
run: ./configure && make
# TODO how cache this?
- run: sudo apt-get update -y && sudo apt-get install -y cmake libgomp1
- run: make loadable static
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-LINUX-X86_64-EXTENSION }}
path: dist/debug/*
build-linux-x86_64-python:
runs-on: ubuntu-latest
needs: [build-linux-x86_64-extension]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-LINUX-X86_64-EXTENSION }}
path: dist/debug/
- uses: actions/setup-python@v3
- run: pip install wheel
- run: make python
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-LINUX-X86_64-WHEELS }}
path: dist/debug/wheels/*.whl
test-linux-x86_64:
runs-on: ubuntu-latest
needs: [build-linux-x86_64-extension, build-linux-x86_64-python]
env:
DENO_DIR: deno_cache
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-LINUX-X86_64-EXTENSION }}
path: dist/debug/
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-LINUX-X86_64-WHEELS }}
path: dist/debug/
- run: pip install --find-links dist/debug/ sqlite_vss
- run: make test-loadable
- run: make test-python
# for test-npm
- uses: actions/setup-node@v3
with:
cache: npm
cache-dependency-path: bindings/node/sqlite-vss/package.json
- run: npm install
working-directory: bindings/node/sqlite-vss
- run: cp dist/debug/vss0.so bindings/node/sqlite-vss-linux-x64/lib
- run: cp dist/debug/vector0.so bindings/node/sqlite-vss-linux-x64/lib
- run: make test-npm
# for test-deno
- uses: denoland/setup-deno@v1
with:
deno-version: v1.30
- uses: actions/cache@v3
with:
path: ${{ env.DENO_DIR }}
key: ${{ runner.os }}-${{ hashFiles('bindings/deno/deno.lock') }}
- run: make test-deno
env:
DENO_SQLITE_VECTOR_PATH: ${{ github.workspace }}/dist/debug/vector0
DENO_SQLITE_VSS_PATH: ${{ github.workspace }}/dist/debug/vss0
build-macos-x86_64-extension:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache sqlite build
id: cache-sqlite-build
uses: actions/cache@v3
with:
path: vendor/sqlite
key: ${{ runner.os }}-${{ hashFiles('vendor/get_sqlite.sh') }}
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
run: ./vendor/get_sqlite.sh
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
working-directory: vendor/sqlite
run: ./configure && make
- run: brew install llvm libomp
- name: Cache cmake build
id: cache-cmake-build
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-build
- run: make patch-openmp
- run: find /usr/local/opt/libomp/*
- run: make loadable static
env:
# `brew info libomp` gives the correct one, with .a file for static openmp builds
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang++
LDFLAGS: "-L/usr/local/opt/libomp/lib"
CPPFLAGS: "-I/usr/local/opt/libomp/include"
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-X86_64-EXTENSION }}
path: dist/debug/*
build-macos-x86_64-python:
runs-on: macos-latest
needs: [build-macos-x86_64-extension]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-X86_64-EXTENSION }}
path: dist/debug/
- uses: actions/setup-python@v3
- run: pip install wheel
- run: make python
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-X86_64-WHEELS }}
path: dist/debug/wheels/*.whl
test-macos-x86_64:
runs-on: macos-latest
needs: [build-macos-x86_64-extension, build-macos-x86_64-python]
# can't get automated tests on macos to work yet :(
if: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-X86_64-EXTENSION }}
path: dist/debug/
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-X86_64-WHEELS }}
path: dist/debug/wheels
#- run: brew install llvm
- run: /usr/local/opt/python@3/libexec/bin/pip install --find-links dist/debug/wheels sqlite_vss
- run: find dist
#- run: make test-loadable python=/usr/local/opt/python@3/libexec/bin/python
#- run: make test-python python=/usr/local/opt/python@3/libexec/bin/python
build-macos-aarch64-extension:
runs-on: [self-hosted, mm1]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache sqlite build
id: cache-sqlite-build
uses: actions/cache@v3
with:
path: vendor/sqlite
key: ${{ runner.os }}-${{ hashFiles('vendor/get_sqlite.sh') }}
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
run: ./vendor/get_sqlite.sh
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
working-directory: vendor/sqlite
run: ./configure && make
- run: make patch-openmp
- run: make loadable static
env:
# `brew info libomp` gives the correct one, with .a file for static openmp builds
CC: /opt/homebrew/opt/llvm/bin/clang
CXX: /opt/homebrew/opt/llvm/bin/clang++
LDFLAGS: "-L/opt/homebrew/opt/libomp/lib"
CPPFLAGS: "-I/opt/homebrew/opt/libomp/include"
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-AARCH64-EXTENSION }}
path: dist/debug/*
build-macos-aarch64-python:
runs-on: [self-hosted, mm1]
needs: [build-macos-aarch64-extension]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-AARCH64-EXTENSION }}
path: dist/debug/
- run: pip3 install wheel
- run: make python IS_MACOS_ARM=1
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-MACOS-AARCH64-WHEELS }}
path: dist/debug/wheels/*.whl
build-windows-x86_64-extension:
runs-on: windows-2019
if: false
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Cache sqlite build
id: cache-sqlite-build
uses: actions/cache@v3
with:
path: vendor/sqlite
key: ${{ runner.os }}-${{ hashFiles('vendor/get_sqlite.sh') }}
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
run: choco install wget --no-progress && ./vendor/get_sqlite.sh
shell: bash
- if: steps.cache-sqlite-build.outputs.cache-hit != 'true'
working-directory: vendor\sqlite
run: ./configure && make
- run: make loadable static
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT-WINDOWS-X86_64-EXTENSION }}
path: dist/debug/*