-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Migrate driver adapters to prisma/prisma (#4380)"
This reverts commit 6dda9d7.
- Loading branch information
Showing
101 changed files
with
5,279 additions
and
348 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
name: Driver Adapters, Smoke Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths-ignore: | ||
- '.github/**' | ||
- '!.github/workflows/driver-adapter-smoke-tests.yml' | ||
- '.buildkite/**' | ||
- '*.md' | ||
- 'LICENSE' | ||
- 'CODEOWNERS' | ||
- 'renovate.json' | ||
|
||
jobs: | ||
driver-adapter-smoke-tests: | ||
name: ${{ matrix.adapter }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
adapter: ['neon:ws', 'neon:http', planetscale, pg, libsql] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
# via package.json rewritten into DATABASE_URL before scripts are run | ||
env: | ||
JS_NEON_DATABASE_URL: ${{ secrets.JS_NEON_DATABASE_URL }} | ||
JS_PLANETSCALE_DATABASE_URL: ${{ secrets.JS_PLANETSCALE_DATABASE_URL }} | ||
JS_PG_DATABASE_URL: postgres://postgres:postgres@localhost:5432/test # ${{ secrets.JS_PG_DATABASE_URL }} | ||
# TODO: test sqld and embedded replicas | ||
JS_LIBSQL_DATABASE_URL: file:/tmp/libsql.db | ||
# TODO: test all three of ("number", "bigint", "string") and conditionally skip some tests as appropriate | ||
JS_LIBSQL_INT_MODE: bigint | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
#cache: 'pnpm' | ||
|
||
- name: Compile Query Engine | ||
run: cargo build -p query-engine-node-api | ||
|
||
- name: Install Dependencies (Driver Adapters) | ||
run: pnpm install | ||
working-directory: ./query-engine/driver-adapters/js | ||
- name: Build Driver Adapters | ||
run: pnpm build | ||
working-directory: ./query-engine/driver-adapters/js | ||
|
||
- run: pnpm prisma:${{ matrix.adapter }} | ||
working-directory: ./query-engine/driver-adapters/js/smoke-test-js | ||
- run: pnpm ${{ matrix.adapter }}:libquery | ||
working-directory: ./query-engine/driver-adapters/js/smoke-test-js | ||
- name: pnpm ${{ matrix.adapter }}:client (using @prisma/client - including engine! - from Npm) | ||
run: pnpm ${{ matrix.adapter }}:client | ||
if: always() | ||
working-directory: ./query-engine/driver-adapters/js/smoke-test-js | ||
|
||
|
||
driver-adapter-smoke-tests-errors: | ||
name: Errors | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# services: | ||
# postgres: | ||
# image: postgres | ||
# env: | ||
# POSTGRES_PASSWORD: postgres | ||
# options: >- | ||
# --health-cmd pg_isready | ||
# --health-interval 10s | ||
# --health-timeout 5s | ||
# --health-retries 5 | ||
# ports: | ||
# - 5432:5432 | ||
|
||
env: | ||
# via package.json rewritten into DATABASE_URL before scripts are run | ||
JS_PG_DATABASE_URL: postgres://postgres:postgres@localhost:5432/test | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
#cache: 'pnpm' | ||
|
||
- name: Compile Query Engine | ||
run: cargo build -p query-engine-node-api | ||
|
||
- name: Install Dependencies (Driver Adapters) | ||
run: pnpm install | ||
working-directory: ./query-engine/driver-adapters/js | ||
- name: Build Driver Adapters | ||
run: pnpm build | ||
working-directory: ./query-engine/driver-adapters/js | ||
|
||
- name: pnpm errors | ||
run: pnpm errors | ||
if: always() | ||
working-directory: ./query-engine/driver-adapters/js/smoke-test-js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Build and publish Prisma Driver Adapters | ||
run-name: npm - release Driver Adapters ${{ github.event.inputs.prismaVersion }} from ${{ github.event.inputs.enginesHash }} on ${{ github.event.inputs.npmDistTag }} | ||
|
||
concurrency: publish-prisma-driver-adapters | ||
|
||
on: | ||
# usually triggered via GH Actions Workflow in prisma/prisma repo | ||
workflow_dispatch: | ||
inputs: | ||
enginesHash: | ||
description: Engine commit hash to checkout for publishing | ||
required: true | ||
prismaVersion: | ||
description: Prisma version to use for publishing | ||
required: true | ||
npmDistTag: | ||
description: npm dist-tag to use for publishing | ||
required: true | ||
default: 'latest' | ||
dryRun: | ||
description: 'Check to do a dry run (does not publish packages)' | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
name: Build and publish Prisma Driver Adapters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Print input | ||
env: | ||
THE_INPUT: '${{ toJson(github.event.inputs) }}' | ||
run: | | ||
echo $THE_INPUT | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.enginesHash }} | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org/' | ||
|
||
- name: Install dependencies | ||
run: pnpm i | ||
working-directory: query-engine/driver-adapters/js | ||
|
||
- name: Build | ||
run: pnpm -r build | ||
working-directory: query-engine/driver-adapters/js | ||
|
||
- name: Update version in package.json | ||
run: | | ||
# find all files package.json, and for each use jq to write the version, then write to temp file and overwrite original file with result | ||
find . -name "package.json" -exec bash -c 'jq --arg version "${{ github.event.inputs.prismaVersion }}" ".version = \$version" "{}" > tmpfile && mv tmpfile "{}"' \; | ||
working-directory: query-engine/driver-adapters/js | ||
|
||
- name: Publish Prisma Driver Adapters packages | ||
run: | | ||
pnpm -r publish --no-git-checks --tag ${{ github.event.inputs.npmDistTag }} ${{ env.DRY_RUN }} | ||
working-directory: query-engine/driver-adapters/js | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
DRY_RUN: ${{ github.event.inputs.dryRun == 'true' && '--dry-run' || '' }} | ||
|
||
# | ||
# Failure handlers | ||
# | ||
|
||
- name: Set current job url in SLACK_FOOTER env var | ||
if: ${{ failure() }} | ||
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV | ||
- name: Slack Notification on Failure | ||
if: ${{ failure() }} | ||
uses: rtCamp/[email protected] | ||
env: | ||
SLACK_TITLE: 'prisma driver adapters publishing failed :x:' | ||
SLACK_COLOR: '#FF0000' | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DRIVER_ADPATERS_FAILING }} |
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
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
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
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
Oops, something went wrong.