feat: CGO swap + sqlite-vec scaffolding #1
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: build | |
| # Local CGO-enabled build matrix. Supersedes the `cgo_enabled: "0"` flag | |
| # passed to the external reusable pipeline in ci.yml — once the driver | |
| # swap lands, ci.yml needs to be updated in the central-ops repo to flip | |
| # cgo_enabled to "1" and add `-tags sqlite_fts5`. This workflow exists so | |
| # PRs to this repo don't break in the meantime and so macOS is covered. | |
| # | |
| # Windows is intentionally not in the matrix: mattn/go-sqlite3 + the | |
| # sqlite-vec extension require a POSIX dlopen/dlsym toolchain. Pure-Go | |
| # fallback is no longer shipped. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test: | |
| name: build+test (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CGO_ENABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Install C toolchain (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y build-essential | |
| - name: Install C toolchain (macOS) | |
| if: runner.os == 'macOS' | |
| # macOS runners ship clang from Xcode Command Line Tools; nothing | |
| # to install, just assert it's on PATH. | |
| run: clang --version | |
| - name: go build | |
| run: go build -tags sqlite_fts5 ./... | |
| - name: go vet | |
| run: go vet -tags sqlite_fts5 $(go list -tags sqlite_fts5 ./... | grep -v /ui/node_modules/) | |
| - name: go test | |
| run: go test -tags sqlite_fts5 -timeout 300s $(go list -tags sqlite_fts5 ./... | grep -v /ui/node_modules/) |