Skip to content

Commit

Permalink
new file
Browse files Browse the repository at this point in the history
  • Loading branch information
aarushik93 committed Apr 19, 2024
1 parent 1fec1c0 commit 3f619e3
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,53 @@ jobs:
build-and-test:
runs-on: ubuntu-latest

services:
postgres:
image: ankane/pgvector:latest
env:
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASS }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U ${{ secrets.DB_USER }} -d ${{ secrets.DB_NAME }}"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3

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

- name: Build & Start Services
- name: Build Docker Image for Codex
run: |
docker build -t codex -f Dockerfile .
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASS: ${{ secrets.DB_PASS }}
DB_NAME: ${{ secrets.DB_NAME }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
USER_DB_ADMIN: ${{ secrets.USER_DB_ADMIN }}
USER_DB_PASS: ${{ secrets.USER_DB_PASS }}
USER_DB_HOST: ${{ secrets.USER_DB_HOST }}
DB_PORT: 5432
RUN_ENV: ci
PORT: 8080

- name: Run Codex Container
run: |
docker-compose -f docker-compose.ci.yml up -d --build
docker run -d --name codex --link postgres:db -p 8080:8000 codex
- name: Wait for DB to be ready
- name: Wait for PostgreSQL
uses: MaximeGoyette/wait-for-it-action@master
with:
host: localhost
host: postgres
port: 5432
timeout: 30

- name: Install dependencies
run: |
Expand All @@ -47,7 +79,8 @@ jobs:
- name: Clean up
if: always()
run: |
docker-compose -f docker-compose.full.yml down
docker stop codex
docker rm codex
env:
DB_USER: ${{ secrets.DB_USER }}
Expand Down

0 comments on commit 3f619e3

Please sign in to comment.