-
Notifications
You must be signed in to change notification settings - Fork 0
255 lines (226 loc) · 6.79 KB
/
main.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: main
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main, next, canary]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
# only run on PRs
if: github.event_name == 'pull_request'
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
test:
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm test-ci
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
# only use token if not a fork PR
token: ${{ github.event.pull_request.head.repo.fork == false && secrets.CODECOV_TOKEN || '' }}
e2e:
# only run on PRs
if: github.event_name == 'pull_request'
name: 'E2E-tests'
needs: [build]
services:
postgres:
image: postgres
env:
POSTGRES_DATABASE: trpcdb
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
env:
NEXTAUTH_SECRET: supersecret
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
strategy:
matrix:
dir: [
.experimental/next-app-dir,
.test/diagnostics-big-router,
.test/internal-types-export,
.test/ssg,
cloudflare-workers,
express-minimal,
express-server,
fastify-server,
minimal-react,
next-formdata,
next-minimal-starter,
next-prisma-starter,
next-prisma-todomvc,
next-prisma-websockets-starter,
# next-sse-chat,
soa,
standalone-server,
tanstack-start,
vercel-edge-runtime,
]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
- name: Install playwright ???
# Seems like some of playwright's system deps aren't being cached, so we're making sure they are installed
run: |
cat ./examples/${{ matrix.dir }}/package.json |
if grep --silent '"@playwright/test"';
then pnpm playwright install chromium;
fi
- run: cp ./examples/${{ matrix.dir }}/.env.example ./examples/${{ matrix.dir }}/.env || true
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start
e2e-deno:
# only run on PRs
if: github.event_name == 'pull_request'
name: 'E2E-tests (Deno)'
needs: [build]
env:
NEXTAUTH_SECRET: supersecret
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# TURBO_REMOTE_ONLY: true
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
strategy:
matrix:
dir: [deno-deploy]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno --version
- run: |
cd ./examples/${{ matrix.dir }}
pnpm dlx start-server-and-test "deno run --allow-net=:8000 --allow-env ./src/index.ts" http://127.0.0.1:8000 "deno run --allow-net --allow-env ./src/client.ts"
e2e-bun:
# only run on PRs
if: github.event_name == 'pull_request'
name: 'E2E-tests (Bun)'
needs: [build]
env:
NEXTAUTH_SECRET: supersecret
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
# TURBO_REMOTE_ONLY: true
runs-on: ${{ matrix.os }}
timeout-minutes: 10
continue-on-error: true
strategy:
matrix:
dir: [bun]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun --version
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start
e2e-legacy-node:
# only run on PRs
if: github.event_name == 'pull_request'
needs: [build]
services:
postgres:
image: postgres
env:
POSTGRES_DATABASE: trpcdb
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
env:
NEXTAUTH_SECRET: supersecret
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
strategy:
matrix:
dir:
[
next-prisma-starter,
next-prisma-websockets-starter,
next-prisma-todomvc,
]
node-start: ['18.x', '20.x']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-start }}
cache: 'pnpm'
- run: node -v
- name: Install playwright ???
# Seems like some of playwright's system deps aren't being cached, so we're making sure they are installed
run: |
cat ./examples/${{ matrix.dir }}/package.json |
if grep --silent '"@playwright/test"';
then pnpm playwright install chromium;
fi
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-dev
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} build type-check
- run: pnpm turbo --filter ./examples/${{ matrix.dir }} test-start
# https://pkg.pr.new
release-tmp:
name: Release using pkg.pr.new
needs: [build]
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup
- run: pnpm build
- run: pnpx pkg-pr-new publish './packages/*'