Start up weaviate also for unit tests #2
This file contains 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: CI Pipeline | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Run Go Tests | |
runs-on: ubuntu-latest | |
services: | |
weaviate: | |
image: semitechnologies/weaviate:nightly | |
ports: | |
- 8080:8080 | |
env: | |
QUERY_DEFAULTS_LIMIT: 25 | |
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' | |
PERSISTENCE_DATA_PATH: '/var/lib/weaviate' | |
DEFAULT_VECTORIZER_MODULE: 'none' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Wait for Weaviate | |
run: | | |
echo "Wait for Weaviate to be ready" | |
timeout=120 | |
counter=0 | |
until curl -sf -o /dev/null "http://localhost:8080/v1/.well-known/ready"; do | |
counter=$((counter + 1)) | |
if [ $counter -ge $timeout ]; then | |
echo "ERROR: Weaviate is not ready after ${timeout}s" | |
exit 1 | |
fi | |
echo "Weaviate is not ready, trying again in 1s" | |
sleep 1 | |
done | |
echo "Weaviate is ready" | |
- name: Run tests | |
run: go test -v ./... | |
examples: | |
name: Run Examples | |
needs: test | |
runs-on: ubuntu-latest | |
services: | |
weaviate: | |
image: semitechnologies/weaviate:nightly | |
ports: | |
- 8080:8080 | |
env: | |
QUERY_DEFAULTS_LIMIT: 25 | |
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' | |
PERSISTENCE_DATA_PATH: '/var/lib/weaviate' | |
DEFAULT_VECTORIZER_MODULE: 'none' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Build k6 with extension | |
run: | | |
go install go.k6.io/xk6/cmd/xk6@latest | |
xk6 build --with github.com/weaviate/xk6-weaviate@latest | |
- name: Wait for Weaviate | |
run: | | |
echo "Wait for Weaviate to be ready" | |
timeout=120 | |
counter=0 | |
until curl -sf -o /dev/null "http://localhost:8080/v1/.well-known/ready"; do | |
counter=$((counter + 1)) | |
if [ $counter -ge $timeout ]; then | |
echo "ERROR: Weaviate is not ready after ${timeout}s" | |
exit 1 | |
fi | |
echo "Weaviate is not ready, trying again in 1s" | |
sleep 1 | |
done | |
echo "Weaviate is ready" | |
- name: Run batch operations example | |
run: ./k6 run examples/batch-operations.js | |
- name: Run tenant operations example | |
run: ./k6 run examples/tenant-operations.js |