new file #4
Workflow file for this run
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: Benchmarks Workflow | ||
on: | ||
push: | ||
branches: | ||
- benchmarks-ci | ||
# pull_request: | ||
# branches: | ||
# - main | ||
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: >- | ||
Check failure on line 24 in .github/workflows/benchmarks.yml GitHub Actions / Benchmarks WorkflowInvalid workflow file
|
||
--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 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 run -d --name codex --link postgres:db -p 8080:8000 codex | ||
- name: Wait for PostgreSQL | ||
uses: MaximeGoyette/wait-for-it-action@master | ||
with: | ||
host: postgres | ||
port: 5432 | ||
timeout: 30 | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Run Database Migrations | ||
run: | | ||
poetry run prisma migrate dev --name updates | ||
- name: Populate Database | ||
run: | | ||
./run populate-db | ||
- name: Run Tests | ||
run: | | ||
./run benchmark | ||
- name: Clean up | ||
if: always() | ||
run: | | ||
docker stop codex | ||
docker rm codex | ||
env: | ||
DB_USER: ${{ secrets.DB_USER }} | ||
DB_PASS: ${{ secrets.DB_PASS }} | ||
DB_NAME: ${{ secrets.DB_NAME }} | ||
DB_PORT: 5432 | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
RUN_ENV: ci | ||
PORT: 8080 |