Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
fce7f60
ci(github): Build Linux engines (#1)
janpio Nov 22, 2023
67eeb41
add run-name
janpio Nov 22, 2023
85b6eb0
fix: add target_path to Linux Status (x86_64) (#3)
janpio Nov 30, 2023
fcd359c
chore: update actions and autoformat
Jolg42 Jun 10, 2024
1066fe8
ci: do all the things `engineer` CLI does for releasing engines (#4)
Jolg42 Jun 17, 2024
11d5222
remove /target from cache
Jolg42 Jun 17, 2024
dc3a9f9
add release if github.event_name == 'workflow_dispatch'
Jolg42 Jun 17, 2024
55e4249
Comment out push/pr triggers
SevInf Jul 10, 2024
7f939ec
Run on PR (tmp)
SevInf Jul 10, 2024
a8eb599
Remove old pipelines, make commit optional
SevInf Jul 10, 2024
7afe03d
Run linux jobs in docker containers
SevInf Jul 10, 2024
5d40047
Revert "Run linux jobs in docker containers"
SevInf Jul 10, 2024
f718f4f
Remove explicit repository
SevInf Jul 10, 2024
5d38d3d
Try to mount cache dirs, use rust-toolchain files
SevInf Jul 10, 2024
12ded1a
No quotes
SevInf Jul 10, 2024
cd269da
Add osx arm toolchain
SevInf Jul 10, 2024
b5c922b
Uncomment s3 upload
SevInf Jul 10, 2024
419654b
Fix shellcheck
SevInf Jul 10, 2024
1f92a7b
Correct bucket
SevInf Jul 10, 2024
b742d2c
Comment out R2
SevInf Jul 10, 2024
d327069
Setup R2 uploads again
SevInf Jul 10, 2024
b046d88
Add workflow-dispatch for engines-wrapper
SevInf Jul 10, 2024
997cc36
Fix script
SevInf Jul 10, 2024
0a9f4d4
Use github.sha everywhere
SevInf Jul 11, 2024
edb7ecd
Use prisma bot token
SevInf Jul 11, 2024
f1e9591
Use repository dispatch
SevInf Jul 11, 2024
a3aade1
Use short branch name
SevInf Jul 11, 2024
7db82d8
Correct repo for dispatch
SevInf Jul 11, 2024
c499eac
head-ref?
SevInf Jul 11, 2024
a24f166
Skip engines build if no release is necessary
SevInf Jul 11, 2024
9f7f1a1
Add all DBs tested on buildkite to GH Actions
SevInf Jul 11, 2024
9b16698
Split qe test job into multiple jobs because FML
SevInf Jul 11, 2024
f97a079
Adjust job/workflows names
SevInf Jul 11, 2024
aa77410
And again
SevInf Jul 11, 2024
c2374c6
Run mysql as single threaded
SevInf Jul 11, 2024
95ee047
Ignore joins test on old mysql
SevInf Jul 11, 2024
bff9042
Bring back mariadb
SevInf Jul 11, 2024
bcf6606
Organize pipelines better
SevInf Jul 17, 2024
8c7a9b1
Add order by to fix postgres9
SevInf Jul 17, 2024
f05b678
Move DA tests into unified view
SevInf Jul 17, 2024
a4e46f1
Cleanup
SevInf Jul 17, 2024
56b2ac4
Address some of the review comments
SevInf Jul 18, 2024
a887937
Pull command construction into separate script
SevInf Jul 18, 2024
abe3d4f
Correctly check for [integration]
SevInf Jul 18, 2024
91a2846
PR-safe way of getting commit message
SevInf Jul 18, 2024
e8037c8
n1
SevInf Jul 19, 2024
823f3f0
Correct multiline string
SevInf Jul 19, 2024
c6aee02
Checkout different ref
SevInf Jul 19, 2024
3632ef2
Try more things
SevInf Jul 19, 2024
c6ad057
Fix shellcheck
SevInf Jul 19, 2024
9a85652
Check repository owner
SevInf Jul 19, 2024
8a80814
I am sad
SevInf Jul 19, 2024
ec4c72e
permissions?
SevInf Jul 19, 2024
3e7fff4
Revert to prisma bot token
SevInf Jul 19, 2024
83783e1
Revert back to membership check
SevInf Jul 19, 2024
9d5af26
Please
SevInf Jul 19, 2024
1249e88
Uncomment triggers
SevInf Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Build Engines for Apple Intel

on:
workflow_dispatch:
workflow_call:
inputs:
commit:
description: "Commit on the given branch to build"
description: 'Commit on the given branch to build'
type: string
required: false

jobs:
build:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit
name: "MacOS Intel engines build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}"
name: 'MacOS Intel engines build for commit ${{ inputs.commit }}'
env:
SQLITE_MAX_VARIABLE_NUMBER: 250000
SQLITE_MAX_EXPR_DEPTH: 10000
Expand All @@ -20,12 +21,12 @@ jobs:

steps:
- name: Output link to real commit
run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }}
run: echo ${{ github.repository }}/commit/${{ inputs.commit }}

- name: Checkout ${{ github.event.inputs.commit }}
- name: Checkout ${{ inputs.commit }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
ref: ${{ inputs.commit }}

- uses: actions-rust-lang/setup-rust-toolchain@v1

Expand All @@ -35,16 +36,27 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-intel-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- run: |
cargo build --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt

- name: Rename files
working-directory: ${{ github.workspace }}/target/release/
run: |
echo "Files in target/release before renaming"
ls -la .

mv libquery_engine.dylib libquery_engine.dylib.node

echo "Files in target/release after renaming"
ls -la .

- uses: actions/upload-artifact@v4
with:
name: binaries
name: darwin
path: |
${{ github.workspace }}/target/release/schema-engine
${{ github.workspace }}/target/release/prisma-fmt
${{ github.workspace }}/target/release/query-engine
${{ github.workspace }}/target/release/libquery_engine.dylib
${{ github.workspace }}/target/release/libquery_engine.dylib.node
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Build Engines for Apple Silicon

on:
workflow_dispatch:
workflow_call:
inputs:
commit:
description: "Commit on the given branch to build"
description: 'Commit on the given branch to build'
type: string
required: false

jobs:
build:
# Do not change `name`, prisma-engines Buildkite build job depends on this name ending with the commit
name: "MacOS ARM64 (Apple Silicon) engines build on branch ${{ github.event.ref }} for commit ${{ github.event.inputs.commit }}"
name: 'MacOS ARM64 (Apple Silicon) engines build for commit ${{ inputs.commit }}'
env:
SQLITE_MAX_VARIABLE_NUMBER: 250000
SQLITE_MAX_EXPR_DEPTH: 10000
runs-on: macos-13

steps:
- name: Output link to real commit
run: echo ${{ github.repository }}/commit/${{ github.event.inputs.commit }}
run: echo ${{ github.repository }}/commit/${{ inputs.commit }}

- name: Checkout ${{ github.event.inputs.commit }}
- name: Checkout ${{ inputs.commit }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
ref: ${{ inputs.commit }}

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: xcodebuild -showsdks

- name: Install aarch64 toolchain
run: rustup target add aarch64-apple-darwin
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/cache@v4
with:
Expand All @@ -37,16 +37,25 @@ jobs:
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- run: xcodebuild -showsdks

- run: |
cargo build --target=aarch64-apple-darwin --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt

- name: Rename files
working-directory: ${{ github.workspace }}/target/aarch64-apple-darwin/release
run: |
echo "Files in target/release before renaming"
ls -la .

mv libquery_engine.dylib libquery_engine.dylib.node

echo "Files in target/release after renaming"
ls -la .

- uses: actions/upload-artifact@v4
with:
name: binaries
name: darwin-arm64
path: |
${{ github.workspace }}/target/aarch64-apple-darwin/release/schema-engine
${{ github.workspace }}/target/aarch64-apple-darwin/release/prisma-fmt
${{ github.workspace }}/target/aarch64-apple-darwin/release/query-engine
${{ github.workspace }}/target/aarch64-apple-darwin/release/libquery_engine.dylib
${{ github.workspace }}/target/aarch64-apple-darwin/release/libquery_engine.dylib.node
202 changes: 202 additions & 0 deletions .github/workflows/build-engines-linux-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
name: Build Engines for Linux

on:
workflow_call:
inputs:
commit:
description: 'Commit on the given branch to build'
type: string
required: false

jobs:
build:
name: '${{ matrix.target.name }} for commit ${{ inputs.commit }}'
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
# ⚠️ The target names are used to dtermine the directory name when uploaded to the buckets.
# Do not change them.
target:
# Linux Glibc
- name: 'rhel-openssl-1.0.x'
image: 'prismagraphql/build:rhel-libssl1.0.x'
target_string: ''
target_path: ''
features_string: '--features vendored-openssl'
- name: 'rhel-openssl-1.1.x'
image: 'prismagraphql/build:rhel-libssl1.1.x'
target_string: ''
target_path: ''
features_string: ''
- name: 'rhel-openssl-3.0.x'
image: 'prismagraphql/build:rhel-libssl3.0.x'
target_string: ''
target_path: ''
features_string: ''
# Linux Musl
# A better name would be "linux-musl-openssl-1.1.x"
# But we keep the old name for compatibility reasons
- name: 'linux-musl'
image: 'prismagraphql/build:alpine-libssl1.1.x'
target_string: ''
target_path: ''
features_string: ''
- name: 'linux-musl-openssl-3.0.x'
image: 'prismagraphql/build:alpine-libssl3.0.x'
target_string: ''
target_path: ''
features_string: ''
# Linux Static x86_64
# Note that the name should have "-static-"
# Because we look for "-static-" later in the construct_build_command step
- name: 'linux-static-x64'
image: 'prismagraphql/build:linux-static-x64'
target_string: '--target x86_64-unknown-linux-musl'
target_path: 'x86_64-unknown-linux-musl'
features_string: '--features vendored-openssl'
# Linux Glibc ARM64
- name: 'linux-arm64-openssl-1.0.x'
image: 'prismagraphql/build:cross-linux-arm-ssl-1.0.x'
target_string: '--target aarch64-unknown-linux-gnu'
target_path: 'aarch64-unknown-linux-gnu'
features_string: '--features vendored-openssl'
- name: 'linux-arm64-openssl-1.1.x'
image: 'prismagraphql/build:cross-linux-arm-ssl-1.1.x'
target_string: '--target aarch64-unknown-linux-gnu'
target_path: 'aarch64-unknown-linux-gnu'
features_string: ''
- name: 'linux-arm64-openssl-3.0.x'
image: 'prismagraphql/build:cross-linux-arm-ssl-3.0.x'
target_string: '--target aarch64-unknown-linux-gnu'
target_path: 'aarch64-unknown-linux-gnu'
features_string: ''
# Linux Musl ARM64
- name: 'linux-musl-arm64-openssl-1.1.x'
image: 'prismagraphql/build:cross-linux-musl-arm-ssl-1.1.x'
target_string: '--target aarch64-unknown-linux-musl'
target_path: 'aarch64-unknown-linux-musl'
features_string: ''
- name: 'linux-musl-arm64-openssl-3.0.x'
image: 'prismagraphql/build:cross-linux-musl-arm-ssl-3.0.x'
target_string: '--target aarch64-unknown-linux-musl'
target_path: 'aarch64-unknown-linux-musl'
features_string: ''
# Linux Static ARM64
# Note that the name should have "-static-"
# Because we look for "-static-" later in the construct_build_command step
- name: 'linux-static-arm64'
image: 'prismagraphql/build:linux-static-arm64'
target_string: '--target aarch64-unknown-linux-musl'
target_path: 'aarch64-unknown-linux-musl'
features_string: '--features vendored-openssl'

steps:
- name: Output link to commit
if: ${{ inputs.commit }}
run: echo https://github.com/prisma/prisma-engines/commit/${{ inputs.commit }}

- name: Checkout ${{ inputs.commit }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit }}

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Construct build command
id: construct_build_command
env:
TARGET_NAME: ${{ matrix.target.name }}
IMAGE: ${{ matrix.target.image }}
TARGET_STRING: ${{ matrix.target.target_string }}
FEATURES_STRING: ${{ matrix.target.features_string }}
run: |
set -eux;

command=$(bash .github/workflows/utils/constructDockerBuildCommand.sh)

# store command in GitHub output
echo "COMMAND=$command" >> "$GITHUB_OUTPUT"

- name: Show Build Command
env:
COMMAND: ${{ steps.construct_build_command.outputs.COMMAND }}"
run: echo "Build command is $COMMAND"

- name: Execute Build command
run: ${{ steps.construct_build_command.outputs.command }}

- name: Prepare files for "release" target
if: ${{ matrix.target.target_path == '' }}
env:
TARGET_NAME: ${{ matrix.target.name }}
RELEASE_DIR: ${{ github.workspace }}/target/release
run: |
echo "Files in target/release before renaming"
ls -la $RELEASE_DIR

echo "Copying files to engines-artifacts"
cp -r $RELEASE_DIR/ engines-artifacts

echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets"
if [[ "$TARGET_NAME" == *-static-* ]]; then
echo "Current target is static. Skipping."
else
mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node
fi

echo "Files in engines-artifacts after renaming"
ls -la engines-artifacts

- name: Upload artifacts for "release" target
uses: actions/upload-artifact@v4
if: ${{ matrix.target.target_path == '' }}
with:
name: '${{ matrix.target.name }}'
path: |
${{ github.workspace }}/engines-artifacts/libquery_engine.so.node
${{ github.workspace }}/engines-artifacts/schema-engine
${{ github.workspace }}/engines-artifacts/query-engine
${{ github.workspace }}/engines-artifacts/prisma-fmt

- name: Prepare files for "${{ matrix.target.name }}" target
if: ${{ matrix.target.target_path != '' }}
env:
TARGET_NAME: ${{ matrix.target.name }}
RELEASE_DIR: ${{ github.workspace }}/target/${{ matrix.target.target_path }}/release
run: |
echo "Files in target/release before renaming"
ls -la $RELEASE_DIR

echo "Copying files to engines-artifacts"
cp -r $RELEASE_DIR/ engines-artifacts

echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets"
if [[ "$TARGET_NAME" == *-static-* ]]; then
echo "Current target is static. Skipping."
else
mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node
fi

echo "Files in engines-artifacts after renaming"
ls -la engines-artifacts

- name: Upload artifacts for "${{ matrix.target.name }}" target
uses: actions/upload-artifact@v4
if: ${{ matrix.target.target_path != '' }}
with:
name: ${{ matrix.target.name }}
path: |
${{ github.workspace }}/engines-artifacts/libquery_engine.so.node
${{ github.workspace }}/engines-artifacts/schema-engine
${{ github.workspace }}/engines-artifacts/query-engine
${{ github.workspace }}/engines-artifacts/prisma-fmt
Loading