ci(server): add sqlite processing (#7586)

* ci(server): add sqlite processing

* ci(server): try setting DATABASE_URL based on db platform

* fix(server): swap default back to sqlite

* ci(server): go back to database url

---------

Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
This commit is contained in:
Nicholas Tindle
2024-07-24 08:46:39 -05:00
committed by GitHub
parent 22f2a05f08
commit 3e384c9771

View File

@@ -31,10 +31,12 @@ jobs:
matrix:
python-version: ["3.10"]
platform-os: [ubuntu, macos, macos-arm64, windows]
db-platform: [postgres, sqlite]
runs-on: ${{ matrix.platform-os != 'macos-arm64' && format('{0}-latest', matrix.platform-os) || 'macos-14' }}
steps:
- name: Setup PostgreSQL
if: matrix.db-platform == 'postgres'
uses: ikalnytskyi/action-setup-postgres@v6
with:
username: ${{ secrets.DB_USER }}
@@ -114,14 +116,24 @@ jobs:
- name: Install Python dependencies
run: poetry install
- name: Generate Prisma Client
- name: Generate Prisma Client (Postgres)
if: matrix.db-platform == 'postgres'
run: poetry run prisma generate --schema postgres/schema.prisma
- name: Run Database Migrations
- name: Run Database Migrations (Postgres)
if: matrix.db-platform == 'postgres'
run: poetry run prisma migrate dev --schema postgres/schema.prisma --name updates
env:
CONNECTION_STR: ${{ steps.postgres.outputs.connection-uri }}
- name: Generate Prisma Client (SQLite)
if: matrix.db-platform == 'sqlite'
run: poetry run prisma generate
- name: Run Database Migrations (SQLite)
if: matrix.db-platform == 'sqlite'
run: poetry run prisma migrate dev --name updates
- name: Run Linter
run: poetry run lint