name: CI on: push: branches: [main] pull_request: branches: [main] jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest] go-version: ['1.26'] steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Build run: go build -o gortex ./cmd/gortex/ - name: Test run: go test -race -timeout=20m -coverprofile=coverage.out ./... - name: Upload coverage if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.26' uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6 with: files: coverage.out continue-on-error: true build-windows: # CGO build smoke-test on native Windows. tree-sitter needs a C/C++ # compiler — the GitHub windows runner ships mingw-w64 on PATH, so no # extra toolchain setup is required. Build-only: `go build ./...` # compiles every production package without pulling in the # platform-specific test files a full `go test` would. runs-on: windows-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Build CLI run: go build -o gortex.exe ./cmd/gortex/ - name: Build all packages run: go build ./... lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9 with: version: v2.11.4 args: --timeout=10m build-onnx: runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Install ONNX Runtime run: | wget -q https://github.com/microsoft/onnxruntime/releases/download/v1.24.4/onnxruntime-linux-x64-1.24.4.tgz tar xzf onnxruntime-linux-x64-1.24.4.tgz sudo cp onnxruntime-linux-x64-1.24.4/lib/libonnxruntime.so* /usr/local/lib/ sudo ldconfig - name: Build with ONNX tag run: go build -tags embeddings_onnx -o gortex-onnx ./cmd/gortex/ - name: Build default (Hugot bundled — no tag) run: go build -o gortex-default ./cmd/gortex/ - name: Install rust tokenizers library # hugot's XLA session uses the rust tokenizer, statically linked as # -ltokenizers, so the embeddings_gomlx XLA build needs libtokenizers.a # on the linker path. (The pure-Go default and the ONNX build do not.) run: | curl -fsSL https://github.com/daulet/tokenizers/releases/download/v1.27.0/libtokenizers.linux-amd64.tar.gz | tar -xz sudo cp libtokenizers.a /usr/lib/ sudo cp libtokenizers.a /usr/local/lib/ - name: Build with GoMLX + XLA tags run: go build -tags "embeddings_gomlx XLA" -o gortex-gomlx ./cmd/gortex/ - name: Build with GoMLX tag only (compat — some docs/scripts still pass it alone) run: go build -tags embeddings_gomlx -o gortex-gomlx-noxla ./cmd/gortex/ benchmark: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Run benchmarks run: go test -bench=. -benchmem -count=1 -benchtime=1s -timeout=20m ./internal/parser/languages/ ./internal/query/ ./internal/graph/