Skip to content

Commit 8d3c9f5

Browse files
committed
[Prisma] Build compatible CLI with patched Postgres dependencies
1 parent 3ac68d0 commit 8d3c9f5

9 files changed

Lines changed: 1942 additions & 4127 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Compatibility binaries
2+
on:
3+
push:
4+
branches: [gautam/security-compatible-0.6.11]
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
jobs:
9+
build:
10+
name: Build ${{ matrix.target }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- target: aarch64-apple-darwin
16+
runner: namespace-profile-gitar-macos
17+
features: postgresql,mocking
18+
- target: x86_64-unknown-linux-gnu
19+
runner: namespace-profile-gitar
20+
features: postgresql,mocking,vendored-openssl
21+
- target: aarch64-unknown-linux-gnu
22+
runner: namespace-profile-gitar
23+
features: postgresql,mocking,vendored-openssl
24+
runs-on: ${{ matrix.runner }}
25+
steps:
26+
- uses: namespacelabs/nscloud-checkout-action@v8
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
targets: ${{ matrix.target }}
30+
- uses: goto-bus-stop/setup-zig@v2
31+
if: matrix.target == 'aarch64-unknown-linux-gnu'
32+
with:
33+
version: 0.13.0
34+
- run: cargo install cargo-zigbuild --locked
35+
if: matrix.target == 'aarch64-unknown-linux-gnu'
36+
- uses: Swatinem/rust-cache@v2
37+
with:
38+
key: compatibility-${{ matrix.target }}
39+
- name: Build native binary
40+
if: matrix.target != 'aarch64-unknown-linux-gnu'
41+
run: cargo build --locked --release -p prisma-cli --features ${{ matrix.features }} --target ${{ matrix.target }}
42+
- name: Build ARM Linux binary
43+
if: matrix.target == 'aarch64-unknown-linux-gnu'
44+
run: cargo zigbuild --locked --release -p prisma-cli --features ${{ matrix.features }} --target ${{ matrix.target }}
45+
- name: Package binary and source revision
46+
env:
47+
TARGET: ${{ matrix.target }}
48+
run: |
49+
mkdir -p artifacts
50+
cp "target/$TARGET/release/prisma" "artifacts/prisma-cli-$TARGET"
51+
git rev-parse HEAD > artifacts/source-sha.txt
52+
cd artifacts
53+
zip "prisma-cli-$TARGET.zip" "prisma-cli-$TARGET" source-sha.txt
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: prisma-cli-${{ matrix.target }}-${{ github.sha }}
57+
path: artifacts/*.zip
58+
retention-days: 30
59+
driver-tests:
60+
runs-on: namespace-profile-gitar
61+
services:
62+
postgres:
63+
image: postgres:17
64+
env:
65+
POSTGRES_HOST_AUTH_METHOD: trust
66+
ports: [5433:5432]
67+
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
68+
steps:
69+
- uses: actions/checkout@v4
70+
with:
71+
repository: gitarcode/rust-postgres
72+
ref: 58ed93c82fa95b2dbeca36991313306218641136
73+
- uses: dtolnay/rust-toolchain@stable
74+
with:
75+
components: clippy
76+
- uses: Swatinem/rust-cache@v2
77+
- run: cargo clippy -p tokio-postgres -p postgres -p postgres-native-tls --all-targets
78+
- run: cargo test -p postgres-protocol -p tokio-postgres --lib
79+
- run: cargo test -p tokio-postgres --test test pgbouncer_type_lookup_after_deallocate

‎.pre-commit-config.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: check-toml
7+
- id: check-yaml
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer

0 commit comments

Comments
 (0)