diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e9d2f1..3d78b5d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -129,6 +129,43 @@ jobs: with: name: sqlite-vss-macos path: dist/debug/* + build-macos-arm-extension: + name: Building MacOS extension + runs-on: self-hosted + 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 + - name: Cache cmake build + id: cache-cmake-build + uses: actions/cache@v3 + with: + path: build + key: ${{ runner.os }}-build + - run: make loadable + env: + # https://stackoverflow.com/questions/48825416/missing-openmp-c-flags-openmp-c-lib-names + CC: /usr/local/opt/llvm/bin/clang + CXX: /usr/local/opt/llvm/bin/clang++ + LDFLAGS: "-L/usr/local/opt/llvm/lib" + CPPFLAGS: "-I/usr/local/opt/llvm/include" + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: sqlite-vss-macos-arm + path: dist/debug/* build-macos-python: runs-on: macos-latest needs: [build-macos-extension] diff --git a/vendor/get_sqlite.sh b/vendor/get_sqlite.sh index 18e6b13..73862ef 100755 --- a/vendor/get_sqlite.sh +++ b/vendor/get_sqlite.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -euo pipefail + VENDOR_DIR=$(dirname "$0") wget https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz -O $VENDOR_DIR/sqlite.tar.gz