Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build and Test System

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build-api:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build API service
uses: docker/build-push-action@v4
with:
context: ./api
push: false
load: true
tags: lucidata-api:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-llm-engine:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build LLM Engine service
uses: docker/build-push-action@v4
with:
context: ./llm_engine
push: false
load: true
tags: lucidata-llm-engine:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-query-runner:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Query Runner service
uses: docker/build-push-action@v4
with:
context: ./query_runner
push: false
load: true
tags: lucidata-query-runner:latest
cache-from: type=gha
cache-to: type=gha,mode=max

system-test:
needs: [build-api, build-llm-engine, build-query-runner]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Start services with docker-compose
run: |
docker-compose up -d
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1

- name: Wait for services to be healthy
run: |
# Give services some time to start up
echo "Waiting for services to start..."
sleep 30

# Check if API is healthy
if curl -s http://localhost:8000/api/health > /dev/null; then
echo "API is healthy"
else
echo "API health check failed"
docker-compose logs
exit 1
fi

echo "All services are running properly!"

- name: Stop services
if: always() # Ensures this step runs even if previous steps fail
run: docker-compose down
Loading