From a76b20ebec33681fd3b33471924a0e3a2cf1b128 Mon Sep 17 00:00:00 2001 From: Aarushi Date: Fri, 19 Apr 2024 14:40:00 +0100 Subject: [PATCH] wip --- .github/workflows/benchmarks.yml | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/benchmarks.yml diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 00000000..e1498fe4 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,59 @@ +name: Benchmarks Workflow + +on: + push: + branches: + - benchmarks-ci +# pull_request: +# branches: +# - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Docker + uses: docker/setup-buildx-action@v2 + + - name: Build & Start Services + run: | + docker-compose -f docker-compose.full.yml up -d --build + + - name: Wait for DB to be ready + uses: vishnudxb/wait-for-port@v1 + with: + host: localhost + port: 5432 + + - 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-compose -f docker-compose.full.yml down + + 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