Repository navigation
ci(npm-release.yaml): hold npm on the major that published v1.2.0 #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Test" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Quick memory check as a gate (runs on every PR) | |
| memory-gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential clang | |
| - run: ./scripts/vendor.sh | |
| - name: Run AddressSanitizer (quick memory check) | |
| run: make test-asan | |
| env: | |
| CC: clang | |
| build-linux-x86_64-extension: | |
| needs: memory-gate # Require memory tests to pass | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static | |
| - run: uv sync --directory tests | |
| - run: make test-loadable python=./tests/.venv/bin/python | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-linux-x86_64-extension | |
| path: dist/* | |
| build-macos-x86_64-extension: | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - run: uv python install 3.12 | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static | |
| - run: uv sync --directory tests | |
| - run: make test-loadable python=./tests/.venv/bin/python | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-macos-x86_64-extension | |
| path: dist/* | |
| build-macos-aarch64-extension: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - run: uv python install 3.12 | |
| - run: ./scripts/vendor.sh | |
| - run: make loadable static | |
| - run: uv sync --directory tests | |
| - run: make test-loadable python=./tests/.venv/bin/python | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-macos-aarch64-extension | |
| path: dist/* | |
| build-windows-x86_64-extension: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - run: ./scripts/vendor.sh | |
| shell: bash | |
| - run: make sqlite-vec.h | |
| - run: mkdir dist | |
| - run: cl.exe /fPIC -shared /W4 /Ivendor/ /O2 /LD sqlite-vec.c -o dist/vec0.dll | |
| - run: uv sync --directory tests | |
| - run: make test-loadable python=./tests/.venv/Scripts/python.exe | |
| shell: bash | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-windows-x86_64-extension | |
| path: dist/* | |
| build-linux-aarch64-extension: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: green-coding-solutions/eco-ci-energy-estimation@0fd2200a8f02d7939066c535e3642c2ebee9db16 # v5.2 | |
| with: | |
| task: start-measurement | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: sudo apt-get install gcc-arm-linux-gnueabihf | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: make CC=arm-linux-gnueabihf-gcc loadable static | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-linux-aarch64-extension | |
| path: dist/* | |
| - uses: green-coding-solutions/eco-ci-energy-estimation@0fd2200a8f02d7939066c535e3642c2ebee9db16 # v5.2 | |
| with: | |
| task: get-measurement | |
| label: "all" | |
| - uses: green-coding-solutions/eco-ci-energy-estimation@0fd2200a8f02d7939066c535e3642c2ebee9db16 # v5.2 | |
| with: | |
| task: display-results | |
| build-android-extensions: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platforms: | |
| [ | |
| { name: android-aarch64, cc: aarch64-linux-android21-clang }, | |
| { name: android-i686, cc: i686-linux-android21-clang }, | |
| { name: android-x86_64, cc: x86_64-linux-android21-clang }, | |
| { name: android-armv7a, cc: armv7a-linux-androideabi21-clang }, | |
| ] | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: ./scripts/vendor.sh | |
| - uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 | |
| - run: | | |
| sdkmanager --install "ndk;27.0.12077973" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/27.0.12077973" >> $GITHUB_ENV | |
| - run: | | |
| ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/ | |
| ls $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin | |
| - run: | | |
| export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH | |
| make CC=${{ matrix.platforms.cc }} \ | |
| AR=llvm-ar \ | |
| RANLIB=llvm-ranlib \ | |
| STRIP=llvm-strip loadable | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-android-${{ matrix.platforms.name }}-extension | |
| path: dist/*.so | |
| build-ios-extensions: | |
| runs-on: ${{ matrix.platforms.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platforms: [ | |
| { | |
| name: ios-arm64, | |
| target: arm64-apple-ios, | |
| sdk: iphoneos, | |
| runner: macos-14, | |
| }, | |
| #{ | |
| # name: ios-x86_64, | |
| # target: x86_64-apple-ios, | |
| # sdk: iphoneos, | |
| # runner: macos-12, | |
| #}, | |
| { | |
| name: ios-simulator-arm64, | |
| target: arm64-apple-ios-simulator, | |
| sdk: iphonesimulator, | |
| runner: macos-14, | |
| }, | |
| { | |
| name: ios-simulator-x86_64, | |
| target: x86_64-apple-ios-simulator, | |
| sdk: iphonesimulator, | |
| runner: macos-14, | |
| }, | |
| ] | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
| with: | |
| xcode-version: latest-stable | |
| - run: ./scripts/vendor.sh | |
| - run: make CFLAGS="-target ${{ matrix.platforms.target }} -isysroot $(xcrun -sdk ${{ matrix.platforms.sdk }} --show-sdk-path) -fembed-bitcode -DNDEBUG=1" loadable static | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-${{ matrix.platforms.name }}-extension | |
| path: dist/* | |
| build-wasm32-emscripten: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
| with: | |
| version: "latest" | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: make wasm | |
| - run: ls; ls dist; ls dist/.wasm | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-wasm32-emscripten | |
| path: dist/.wasm/* | |
| include-hidden-files: true | |
| build-pyodide: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
| with: | |
| version: "latest" | |
| - run: ./scripts/vendor.sh | |
| - run: make sqlite-vec.h | |
| - run: | | |
| emcc -c ./sqlite-vec.c -o ./sqlite-vec.o -I ./vendor -fPIC -g3 \ | |
| -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -DSQLITE_ENABLE_MATH_FUNCTIONS=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_OMIT_POPEN=1 -DSQLITE_THREADSAFE=0 | |
| emcc ./sqlite-vec.o -o vec0.so -s SIDE_MODULE=1 -g3 -s WASM_BIGINT=1 | |
| - run: ls | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-pyodide | |
| path: vec0.so | |
| build-cosmopolitan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: | | |
| mkdir $HOME/cosmo | |
| curl -L -o cosmocc-$COSMO_VERSION.zip https://github.com/jart/cosmopolitan/releases/download/$COSMO_VERSION/cosmocc-$COSMO_VERSION.zip | |
| unzip cosmocc-$COSMO_VERSION.zip -d $HOME/cosmo | |
| env: | |
| COSMO_VERSION: "3.5.4" | |
| - run: ./scripts/vendor.sh | |
| - run: make cli CC=$HOME/cosmo/bin/cosmocc AR=$HOME/cosmo/bin/cosmoar OMIT_SIMD=1 | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sqlite-vec-cosmopolitan | |
| path: dist/* | |
| test-minimum: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: make sqlite-vec.h | |
| - run: make test | |
| working-directory: tests/minimum |