Skip to content

Remove deprecated version from docker-compose.test.yml and fix test c… #6

Remove deprecated version from docker-compose.test.yml and fix test c…

Remove deprecated version from docker-compose.test.yml and fix test c… #6

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
release:
types: [ published ]
env:
GO_VERSION: '1.24'
BINARY_NAME: 'manticore-mcp-server'
jobs:
test:
name: Test and Lint
runs-on: ubuntu-latest
services:
manticore:
image: manticoresearch/manticore:latest
ports:
- 9308:9308
- 9312:9312
options: >-
--health-cmd="wget -q --post-data='SHOW STATUS' -O - 'http://localhost:9308/sql?mode=raw' | grep -q 'uptime'"
--health-interval=5s
--health-timeout=3s
--health-retries=10
--health-start-period=10s
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: make deps
- name: Install moq for code generation
run: go install github.com/matryer/moq@latest
- name: Check formatting
run: make fmt-check
- name: Generate code
run: make generate
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
- name: Wait for Manticore
run: |
for i in {1..30}; do
if wget -q --post-data='SHOW STATUS' -O - 'http://localhost:9308/sql?mode=raw' | grep -q 'uptime'; then
echo "Manticore is ready"
break
fi
echo "Waiting for Manticore... ($i/30)"
sleep 2
done
- name: Run all tests with coverage
run: make test
env:
MANTICORE_URL: http://localhost:9308
build:
name: Build Cross-Platform Binaries
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: make deps
- name: Build all platforms
run: make build-all
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
path: build/
retention-days: 30
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: make deps
- name: Create release archives
run: make release
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
build/*.tar.gz
build/*.zip
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}