Skip to content

feat(search): add implementation-first ranking mode #89

feat(search): add implementation-first ranking mode

feat(search): add implementation-first ranking mode #89

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux: use sqlite-vec (go-libsql doesn't have Linux prebuilts)
- os: ubuntu-latest
backend: sqlite_vec
tags: "-tags=sqlite_vec"
# macOS: use libSQL (default, has prebuilt binaries)
- os: macos-latest
backend: libsql
tags: ""
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.27'
cache: true
- name: Install dependencies
run: go mod download
- name: Build (${{ matrix.backend }})
run: go build ${{ matrix.tags }} -v ./...
- name: Build with FTS5 (${{ matrix.backend }})
env:
CGO_CFLAGS: "-DSQLITE_ENABLE_FTS5"
run: go build ${{ matrix.tags }} -v ./...
- name: Test (${{ matrix.backend }})
env:
CGO_CFLAGS: "-DSQLITE_ENABLE_FTS5"
CGO_LDFLAGS: "-lm"
run: go test ${{ matrix.tags }} -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload macOS crash reports
if: failure() && runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: macos-crash-reports-${{ github.run_attempt }}
path: |
~/Library/Logs/DiagnosticReports/
/Library/Logs/DiagnosticReports/
if-no-files-found: warn
retention-days: 7
- name: Test portable SIMD kernels
if: runner.os == 'Linux'
env:
GOEXPERIMENT: simd
run: go test ./pkg/util
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: coverage.txt
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.27'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
# Keep this in sync with GOLANGCI_LINT_VERSION in the Makefile.
version: v2.13.1
args: --timeout=5m --build-tags=sqlite_vec
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux: sqlite-vec backend
- os: ubuntu-latest
goos: linux
goarch: amd64
tags: "-tags=sqlite_vec"
# macOS: libSQL backend (default)
- os: macos-latest
goos: darwin
goarch: arm64
tags: ""
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.27'
cache: true
- name: Build binary
env:
CGO_CFLAGS: "-DSQLITE_ENABLE_FTS5"
run: go build ${{ matrix.tags }} -o sgrep-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/sgrep
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sgrep-${{ matrix.goos }}-${{ matrix.goarch }}
path: sgrep-*