-
Notifications
You must be signed in to change notification settings - Fork 249
112 lines (99 loc) · 3.47 KB
/
test-query-engine-driver-adapters.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test Driver Adapters
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/query-engine-driver-adapters.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
- 'CODEOWNERS'
- 'renovate.json'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-query-engine-tests:
name: '${{ matrix.adapter.name }} on node v${{ matrix.node_version }}'
strategy:
fail-fast: false
matrix:
adapter:
- name: '@prisma/adapter-planetscale'
setup_task: 'dev-planetscale-js'
- name: '@prisma/adapter-pg (napi)'
setup_task: 'dev-pg-js'
- name: '@prisma/adapter-neon (ws) (napi)'
setup_task: 'dev-neon-js'
- name: '@prisma/adapter-libsql (Turso) (napi)'
setup_task: 'dev-libsql-js'
# TODO: uncomment when WASM engine is functional
# - name: '@prisma/adapter-planetscale'
# setup_task: 'dev-planetscale-wasm'
# needs_wasm_pack: true
# - name: '@prisma/adapter-pg (wasm)'
# setup_task: 'dev-pg-wasm'
# needs_wasm_pack: true
# - name: '@prisma/adapter-neon (ws) (wasm)'
# setup_task: 'dev-neon-wasm'
# needs_wasm_pack: true
# - name: '@prisma/adapter-libsql (Turso) (wasm)'
# setup_task: 'dev-libsql-wasm'
# needs_wasm_pack: true
node_version: ['18']
env:
LOG_LEVEL: 'info' # Set to "debug" to trace the query engine and node process running the driver adapter
LOG_QUERIES: 'y'
RUST_LOG: 'info'
RUST_LOG_FORMAT: 'devel'
RUST_BACKTRACE: '1'
CLICOLOR_FORCE: '1'
CLOSED_TX_CLEANUP: '2'
SIMPLE_TEST_MODE: '1'
QUERY_BATCH_SIZE: '10'
WORKSPACE_ROOT: ${{ github.workspace }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: 'Setup pnpm'
uses: pnpm/action-setup@v2
with:
version: 8
- name: 'Get pnpm store directory'
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 'Login to Docker Hub'
uses: docker/login-action@v3
continue-on-error: true
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Branch Name
id: extract-branch
run: |
branch="$(git show -s --format=%s | grep -o "DRIVER_ADAPTERS_BRANCH=[^ ]*" | cut -f2 -d=)"
if [ -n "$branch" ]; then
echo "Using $branch branch of driver adapters"
echo "DRIVER_ADAPTERS_BRANCH=$branch" >> "$GITHUB_ENV"
fi
- uses: dtolnay/rust-toolchain@stable
- name: 'Install wasm-pack'
if: ${{ matrix.adapter.needs_wasm_pack }}
run: cargo install wasm-pack
- run: make ${{ matrix.adapter.setup_task }}
- name: 'Run tests'
run: cargo test --package query-engine-tests -- --test-threads=1