Repository navigation
86 lines (73 loc) · 2.77 KB
/
Copy pathtest.yml
File metadata and controls
86 lines (73 loc) · 2.77 KB
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
name: Test
on:
push:
branches:
- main
pull_request:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
- name: Enable pnpm
shell: bash
run: |
corepack enable
PNPM_VERSION="$(node -p 'const pm = require("./package.json").packageManager; const match = pm && pm.match(/^pnpm@(.+)$/); if (!match) throw new Error("packageManager must be pnpm@<version>"); match[1]')"
corepack prepare "pnpm@${PNPM_VERSION}" --activate
echo "PNPM_STORE_PATH=$(pnpm store path)" >> "$GITHUB_ENV"
- name: Cache pnpm store
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.PNPM_STORE_PATH }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- 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 anything imports them.
- name: Build workspace packages
run: pnpm build
- name: Run CLI tests
run: pnpm --filter @prisma/cli test
# A changed engine must claim a version the registry does not have
# yet, or the release ships a CLI built against exports the published
# engine lacks (how prisma@8.0.0-rc.4 broke `npx prisma@next`).
engine-version:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
- name: The engine version must be new if the engine changed
env:
# The base branch by name: the event's base.sha is recorded when
# the pull request is created and goes stale as the base moves,
# which blamed other merges' engine changes on unrelated PRs.
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: node scripts/check-engine-version.mjs "origin/$BASE_REF"