Skip to content

ADR 0004: one engine per install — the strategy, both handover briefs, and the engine decoupled from the lockstep #553

ADR 0004: one engine per install — the strategy, both handover briefs, and the engine decoupled from the lockstep

ADR 0004: one engine per install — the strategy, both handover briefs, and the engine decoupled from the lockstep #553

name: Preview CLI Package
on:
pull_request:
types:
- opened
- synchronize
- reopened
concurrency:
group: preview-cli-package-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
cache: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Build every workspace package up front via the turbo graph so
# workspace:* dependencies (the CLI's @prisma/cli-engine) have
# their dist output before the test and build steps below.
- name: Build workspace packages
run: pnpm build
- name: Run focused CLI tests
id: cli_tests
run: pnpm --filter @prisma/cli test
- name: Run compute tests
id: compute_tests
run: pnpm --filter @prisma/compute test
- name: Build CLI package
id: cli_build
run: pnpm --filter @prisma/cli build
- name: Build compute package
id: compute_build
run: pnpm --filter @prisma/compute build
# No version stamping: pkg.pr.new serves the tarball at a per-commit
# URL, so the committed base version (`8.0.0-rc.N`) ships as-is —
# same model as prisma/prisma's preview-publish.yml. The engine is
# published alongside the cli so its `workspace:` pin resolves to
# the preview build rather than the registry.
- name: Publish installable PR preview
id: publish_preview
continue-on-error: ${{ vars.CLI_PR_PREVIEW_REQUIRED != 'true' }}
run: pnpm exec pkg-pr-new publish --bin --comment=update packages/cli packages/cli-engine
- name: Summarize PR preview publish
if: ${{ always() }}
run: |
{
echo "## Preview CLI Package"
echo
echo "- CLI tests: \`${{ steps.cli_tests.outcome || 'skipped' }}\`"
echo "- Compute tests: \`${{ steps.compute_tests.outcome || 'skipped' }}\`"
echo "- Build: \`${{ steps.cli_build.outcome || 'skipped' }}\`"
echo "- Compute build: \`${{ steps.compute_build.outcome || 'skipped' }}\`"
echo "- pkg.pr.new publish: \`${{ steps.publish_preview.outcome || 'skipped' }}\`"
PUBLISH_OUTCOME="${{ steps.publish_preview.outcome || 'skipped' }}"
if [ "${PUBLISH_OUTCOME}" != "success" ]; then
echo
echo "pkg.pr.new publishing is best-effort while \`CLI_PR_PREVIEW_REQUIRED\` is not \`true\`. If this failed, confirm the pkg.pr.new GitHub App is installed for this repository and rerun the workflow."
fi
} >> "$GITHUB_STEP_SUMMARY"