Skip to content

Commit c3fe0a4

Browse files
committed
Update latest pipeline
1 parent e5790ad commit c3fe0a4

File tree

2 files changed

+288
-40
lines changed

2 files changed

+288
-40
lines changed

.github/workflows/release-feature-branch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ jobs:
216216
217217
esac
218218
219-
220219
attw:
221220
# only run on all pushes or pull requests from forks
222221
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
@@ -289,6 +288,7 @@ jobs:
289288
fi
290289
291290
- name: Build Prisma client
291+
if: steps.checks.outputs.has_new_release == 'true'
292292
working-directory: drizzle-orm
293293
run: pnpm prisma generate --schema src/prisma/schema.prisma
294294

.github/workflows/release-latest.yaml

+287-39
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,286 @@ name: Release (latest)
33
on: workflow_dispatch
44

55
jobs:
6+
test:
7+
strategy:
8+
matrix:
9+
shard:
10+
- gel
11+
- planetscale
12+
- singlestore-core
13+
- singlestore-proxy
14+
- singlestore-prefixed
15+
- singlestore-custom
16+
- neon-http
17+
- neon-serverless
18+
- drizzle-orm
19+
- drizzle-kit
20+
- drizzle-zod
21+
- drizzle-seed
22+
- drizzle-typebox
23+
- drizzle-valibot
24+
- other
25+
runs-on: ubuntu-20.04
26+
services:
27+
postgres-postgis:
28+
image: postgis/postgis:16-3.4
29+
env:
30+
POSTGRES_USER: postgres
31+
POSTGRES_PASSWORD: postgres
32+
POSTGRES_DB: drizzle
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
ports:
39+
- 54322:5432
40+
postgres-vector:
41+
image: pgvector/pgvector:pg16
42+
env:
43+
POSTGRES_USER: postgres
44+
POSTGRES_PASSWORD: postgres
45+
POSTGRES_DB: drizzle
46+
options: >-
47+
--health-cmd pg_isready
48+
--health-interval 10s
49+
--health-timeout 5s
50+
--health-retries 5
51+
ports:
52+
- 54321:5432
53+
postgres:
54+
image: postgres:14
55+
env:
56+
POSTGRES_USER: postgres
57+
POSTGRES_PASSWORD: postgres
58+
POSTGRES_DB: drizzle
59+
options: >-
60+
--health-cmd pg_isready
61+
--health-interval 10s
62+
--health-timeout 5s
63+
--health-retries 5
64+
ports:
65+
- 55433:5432
66+
mysql:
67+
image: mysql:8
68+
env:
69+
MYSQL_ROOT_PASSWORD: root
70+
MYSQL_DATABASE: drizzle
71+
options: >-
72+
--health-cmd "mysqladmin ping"
73+
--health-interval 10s
74+
--health-timeout 5s
75+
--health-retries 5
76+
ports:
77+
- 33306:3306
78+
singlestore:
79+
image: ghcr.io/singlestore-labs/singlestoredb-dev:latest
80+
env:
81+
ROOT_PASSWORD: singlestore
82+
ports:
83+
- 33307:3306
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- uses: actions/setup-node@v4
88+
with:
89+
node-version: '20.19'
90+
registry-url: 'https://registry.npmjs.org'
91+
92+
- uses: pnpm/action-setup@v3
93+
name: Install pnpm
94+
id: pnpm-install
95+
with:
96+
version: latest
97+
run_install: false
98+
99+
- name: Get pnpm store directory
100+
id: pnpm-cache
101+
shell: bash
102+
run: |
103+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
104+
105+
- uses: actions/cache@v4
106+
name: Setup pnpm cache
107+
with:
108+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
109+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
110+
restore-keys: |
111+
${{ runner.os }}-pnpm-store-
112+
113+
- name: Install dependencies
114+
run: pnpm install
115+
116+
- name: Build Prisma client
117+
working-directory: drizzle-orm
118+
run: pnpm prisma generate --schema src/prisma/schema.prisma
119+
120+
- name: Build
121+
run: pnpm build
122+
123+
- name: Run tests
124+
env:
125+
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:55433/drizzle
126+
PG_VECTOR_CONNECTION_STRING: postgres://postgres:postgres@localhost:54321/drizzle
127+
PG_POSTGIS_CONNECTION_STRING: postgres://postgres:postgres@localhost:54322/drizzle
128+
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:33306/drizzle
129+
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
130+
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
131+
# NEON_HTTP_CONNECTION_STRING: postgres://postgres:[email protected]:5432/postgres
132+
NEON_HTTP_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
133+
NEON_SERVERLESS_CONNECTION_STRING: postgres://postgres:postgres@localhost:5445/postgres
134+
TIDB_CONNECTION_STRING: ${{ secrets.TIDB_CONNECTION_STRING }}
135+
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
136+
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
137+
LIBSQL_URL: file:local.db
138+
LIBSQL_REMOTE_URL: ${{ secrets.LIBSQL_REMOTE_URL }}
139+
LIBSQL_REMOTE_TOKEN: ${{ secrets.LIBSQL_REMOTE_TOKEN }}
140+
SINGLESTORE_CONNECTION_STRING: singlestore://root:singlestore@localhost:33307/
141+
working-directory: integration-tests
142+
run: |
143+
case ${{ matrix.shard }} in
144+
145+
gel)
146+
pnpm vitest run tests/gel
147+
;;
148+
149+
planetscale)
150+
pnpm vitest run \
151+
tests/mysql/mysql-planetscale.test.ts \
152+
tests/relational/mysql.planetscale-v1.test.ts \
153+
tests/relational/mysql.planetscale.test.ts
154+
;;
155+
156+
singlestore-core)
157+
pnpm vitest run tests/singlestore/singlestore.test.ts
158+
;;
159+
160+
singlestore-proxy)
161+
pnpm vitest run tests/singlestore/singlestore-proxy.test.ts
162+
;;
163+
164+
singlestore-prefixed)
165+
pnpm vitest run tests/singlestore/singlestore-prefixed.test.ts
166+
;;
167+
168+
singlestore-custom)
169+
pnpm vitest run tests/singlestore/singlestore-custom.test.ts
170+
;;
171+
172+
neon-http)
173+
pnpm vitest run tests/pg/neon-http.test.ts tests/pg/neon-http-batch.test.ts
174+
;;
175+
176+
neon-serverless)
177+
docker compose -f docker-neon.yml up -d
178+
pnpm vitest run tests/pg/neon-serverless.test.ts
179+
docker compose -f docker-neon.yml down
180+
;;
181+
182+
drizzle-orm|drizzle-kit|drizzle-zod|drizzle-seed|drizzle-typebox|drizzle-valibot)
183+
(cd .. && pnpm test --filter ${{ matrix.shard }})
184+
;;
185+
186+
other)
187+
pnpm vitest run \
188+
--exclude tests/gel \
189+
--exclude tests/mysql/mysql-planetscale.test.ts \
190+
--exclude tests/relational/mysql.planetscale-v1.test.ts \
191+
--exclude tests/relational/mysql.planetscale.test.ts \
192+
--exclude tests/singlestore/singlestore.test.ts \
193+
--exclude tests/singlestore/singlestore-proxy.test.ts \
194+
--exclude tests/singlestore/singlestore-prefixed.test.ts \
195+
--exclude tests/singlestore/singlestore-custom.test.ts \
196+
--exclude tests/pg/neon-http.test.ts \
197+
--exclude tests/pg/neon-http-batch.test.ts \
198+
--exclude tests/pg/neon-serverless.test.ts
199+
;;
200+
201+
esac
202+
203+
attw:
204+
strategy:
205+
matrix:
206+
package:
207+
- drizzle-orm
208+
- drizzle-kit
209+
- drizzle-zod
210+
- drizzle-seed
211+
- drizzle-typebox
212+
- drizzle-valibot
213+
- eslint-plugin-drizzle
214+
runs-on: ubuntu-20.04
215+
steps:
216+
- uses: actions/checkout@v4
217+
218+
- uses: actions/setup-node@v4
219+
with:
220+
node-version: '18.18'
221+
registry-url: 'https://registry.npmjs.org'
222+
223+
- uses: pnpm/action-setup@v3
224+
name: Install pnpm
225+
id: pnpm-install
226+
with:
227+
version: latest
228+
run_install: false
229+
230+
- name: Get pnpm store directory
231+
id: pnpm-cache
232+
shell: bash
233+
run: |
234+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
235+
236+
- uses: actions/cache@v4
237+
name: Setup pnpm cache
238+
with:
239+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
240+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
241+
restore-keys: |
242+
${{ runner.os }}-pnpm-store-
243+
244+
- name: Install dependencies
245+
run: pnpm install
246+
247+
- name: Install Bun
248+
uses: oven-sh/setup-bun@v2
249+
250+
- name: Check preconditions
251+
id: checks
252+
shell: bash
253+
working-directory: ${{ matrix.package }}
254+
run: |
255+
latest="$(npm view --json ${{ matrix.package }} dist-tags.latest | jq -r)"
256+
version="$(jq -r .version package.json)"
257+
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
258+
259+
if [[ "$is_version_published" == "false" && "$latest" != "$version" ]]; then
260+
{
261+
echo "version=$version"
262+
echo "has_new_release=true"
263+
echo "changelog_path=$changelogPath"
264+
} >> $GITHUB_OUTPUT
265+
fi
266+
267+
- name: Build Prisma client
268+
if: steps.checks.outputs.has_new_release == 'true'
269+
working-directory: drizzle-orm
270+
run: pnpm prisma generate --schema src/prisma/schema.prisma
271+
272+
- name: Build
273+
if: steps.checks.outputs.has_new_release == 'true'
274+
run: pnpm build
275+
276+
- name: Pack
277+
if: steps.checks.outputs.has_new_release == 'true'
278+
working-directory: ${{ matrix.package }}
279+
run: npm run pack
280+
281+
- name: Run @arethetypeswrong/cli
282+
if: steps.checks.outputs.has_new_release == 'true'
283+
working-directory: ${{ matrix.package }}
284+
run: bunx attw package.tgz
285+
6286
release:
7287
permissions: write-all
8288
strategy:
@@ -133,54 +413,22 @@ jobs:
133413
echo "\`$version\` is already latest on NPM" >> $GITHUB_STEP_SUMMARY
134414
fi
135415
136-
- name: Build
416+
- name: Build Prisma client
137417
if: steps.checks.outputs.has_new_release == 'true'
138-
run: |
139-
(
140-
cd drizzle-orm
141-
pnpm prisma generate --schema src/prisma/schema.prisma
142-
)
143-
pnpm build
418+
working-directory: drizzle-orm
419+
run: pnpm prisma generate --schema src/prisma/schema.prisma
144420

145-
- name: Run tests
421+
- name: Build
146422
if: steps.checks.outputs.has_new_release == 'true'
147-
env:
148-
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:55433/drizzle
149-
PG_VECTOR_CONNECTION_STRING: postgres://postgres:postgres@localhost:54321/drizzle
150-
PG_POSTGIS_CONNECTION_STRING: postgres://postgres:postgres@localhost:54322/drizzle
151-
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:33306/drizzle
152-
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
153-
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
154-
TIDB_CONNECTION_STRING: ${{ secrets.TIDB_CONNECTION_STRING }}
155-
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
156-
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
157-
LIBSQL_URL: file:local.db
158-
LIBSQL_REMOTE_URL: ${{ secrets.LIBSQL_REMOTE_URL }}
159-
LIBSQL_REMOTE_TOKEN: ${{ secrets.LIBSQL_REMOTE_TOKEN }}
160-
run: |
161-
if [[ "${{ matrix.package }}" == "drizzle-orm" ]]; then
162-
pnpm test --filter ${{ matrix.package }} --filter integration-tests
163-
else
164-
pnpm test --filter ${{ matrix.package }}
165-
fi
423+
run: pnpm build
166424

167425
- name: Pack
168426
if: steps.checks.outputs.has_new_release == 'true'
169427
working-directory: ${{ matrix.package }}
170428
shell: bash
171429
env:
172430
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
173-
run: |
174-
npm run pack
175-
176-
- name: Run @arethetypeswrong/cli
177-
if: steps.checks.outputs.has_new_release == 'true'
178-
working-directory: ${{ matrix.package }}
179-
shell: bash
180-
env:
181-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
182-
run: |
183-
pnpm attw package.tgz
431+
run: npm run pack
184432

185433
- name: Publish
186434
if: steps.checks.outputs.has_new_release == 'true'
@@ -261,4 +509,4 @@ jobs:
261509
});
262510
} catch (e) {
263511
core.setFailed(e.message);
264-
}
512+
}

0 commit comments

Comments
 (0)