Repository navigation
140 lines (115 loc) · 4.55 KB
/
Copy pathtest.yml
File metadata and controls
140 lines (115 loc) · 4.55 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Test
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
pull-requests: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '26'
cache: 'npm'
- name: Install npm 11.12.1
run: npm install -g npm@11.12.1
- name: Install dependencies
run: npm ci
- name: Run workspace tests
run: npm run test:run --workspaces --if-present
- name: Build the web UI
run: npm run build:web
# The terminal UI's tests run on each OS the release builds it for. linux-arm64
# shares the Linux x64 code, so it has no job of its own.
cli:
name: cli (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- id: cargo-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
cli/target
key: test-cli-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml', 'cli/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
test-cli-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml', 'cli/Cargo.lock') }}-
- name: Run tests
run: cargo test --manifest-path cli/Cargo.toml --locked
- if: github.event_name == 'push'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
cli/target
key: ${{ steps.cargo-cache.outputs.cache-primary-key }}
backend:
name: backend (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- id: cargo-cache
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
backend/target
extensions/target
key: test-backend-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml', 'backend/Cargo.lock', 'extensions/Cargo.lock') }}-${{ github.sha }}
restore-keys: |
test-backend-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('rust-toolchain.toml', 'backend/Cargo.lock', 'extensions/Cargo.lock') }}-
# The Prisma CLI interop tests run `prisma migrate deploy` against what the
# runtime's migrator wrote, so Node and the workspace's packages are here too.
- if: runner.os != 'Windows'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '26'
cache: 'npm'
- if: runner.os != 'Windows'
run: npm install -g npm@11.12.1 && npm ci
# The backend tests load the example extensions that this builds.
- name: Build the example extensions
if: runner.os != 'Windows'
working-directory: extensions
run: cargo build --release --locked
- name: Test the extension SDK
if: runner.os == 'Linux'
working-directory: extensions
run: |
cargo test --locked --workspace --target "$(rustc -vV | sed -n 's/^host: //p')"
- name: Run tests
if: runner.os != 'Windows'
run: cargo test --manifest-path backend/Cargo.toml --locked --all-features
# Windows ships the standalone binary; the tests lean on Unix tools, so this
# checks that every target builds there.
- name: Build on Windows
if: runner.os == 'Windows'
run: cargo check --manifest-path backend/Cargo.toml --locked --all-targets
- name: Run path tests on Windows
if: runner.os == 'Windows'
run: cargo test --manifest-path backend/Cargo.toml --locked --lib -- support::path tools::shell::workspace
- if: github.event_name == 'push'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
backend/target
extensions/target
key: ${{ steps.cargo-cache.outputs.cache-primary-key }}