-
-
Notifications
You must be signed in to change notification settings - Fork 995
261 lines (244 loc) · 7.7 KB
/
ci.yml
File metadata and controls
261 lines (244 loc) · 7.7 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
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
256
257
258
259
260
261
name: ci
on:
push:
branches: [main, next]
pull_request:
branches: ['*']
paths-ignore:
- 'docs/**'
- '.vscode/**'
- 'README.md'
- '.gitignore'
- 'LICENSE'
jobs:
coverage:
name: 'Coverage'
runs-on: ubuntu-latest
needs:
- main
- bun
- deno
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v6
with:
pattern: coverage-*
merge-multiple: true
path: ./coverage
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
directory: ./coverage
main:
name: 'Main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run format
- run: bun run lint
- run: bun run editorconfig-checker -format github-actions
- run: bun run build
- run: bun run test
- uses: actions/upload-artifact@v5
with:
name: coverage-main
path: coverage/
jsr-dry-run:
name: "Checking if it's valid for JSR"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: denoland/setup-deno@v2
with:
deno-version-file: '.tool-versions'
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bunx jsr publish --dry-run
deno:
name: 'Deno'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: denoland/setup-deno@v2
with:
deno-version-file: '.tool-versions'
- run: env NAME=Deno deno test --coverage=coverage/raw/deno-runtime --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno
- run: deno test -c runtime-tests/deno-jsx/deno.precompile.json --coverage=coverage/raw/deno-precompile-jsx runtime-tests/deno-jsx
- run: deno test -c runtime-tests/deno-jsx/deno.react-jsx.json --coverage=coverage/raw/deno-react-jsx runtime-tests/deno-jsx
- run: grep -R '"url":' coverage | grep -v runtime-tests | sed -e 's/.*file:..//;s/.,//' | xargs deno cache --unstable-sloppy-imports
- run: deno coverage --lcov > coverage/deno-runtime-coverage-lcov.info
- uses: actions/upload-artifact@v5
with:
name: coverage-deno
path: coverage/
bun:
name: 'Bun'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run test:bun
- uses: actions/upload-artifact@v5
with:
name: coverage-bun
path: coverage/
bun-windows:
name: 'Bun - Windows'
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun run test:bun
fastly:
name: 'Fastly Compute'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:fastly
node:
name: 'Node.js v${{ matrix.node }}'
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18.18.2', '20.x', '22.x']
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:node
workerd:
name: 'workerd'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:workerd
lambda:
name: 'AWS Lambda'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:lambda
lambda-edge:
name: 'Lambda@Edge'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test:lambda-edge
perf-measures-check-on-pr:
name: 'Type & Bundle size Check on PR'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/perf-measures
with:
target-ref: 'auto'
http-benchmark-on-pr:
name: 'HTTP Speed Check on PR'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.tool-versions'
- run: bun install --frozen-lockfile
- name: Install bombardier
run: |
wget -O bombardier https://github.com/codesenberg/bombardier/releases/download/v2.0.1/bombardier-linux-amd64
chmod +x bombardier
sudo mv bombardier /usr/local/bin/
- name: Run HTTP benchmark
run: |
cd benchmarks/http-server
bun run benchmark.ts
- name: Comment PR
uses: actions/github-script@v7
if: github.event.pull_request.head.repo.full_name == github.repository
with:
script: |
const fs = require('fs');
const results = fs.readFileSync('benchmarks/http-server/benchmark-results.md', 'utf8');
// Minimize previous benchmark comments
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
for (const comment of comments.data) {
if (comment.body.includes('## HTTP Performance Benchmark')) {
await github.graphql(`
mutation {
minimizeComment(input: { subjectId: "${comment.node_id}", classifier: OUTDATED }) {
minimizedComment {
isMinimized
}
}
}
`);
}
}
// Post new comment
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: results
});
- name: Show benchmark results for forks
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "## HTTP Performance Benchmark Results"
echo "Note: Cannot post comment due to security restrictions on fork PRs"
cat benchmarks/http-server/benchmark-results.md
perf-measures-check-on-main:
name: 'Type & Bundle size Check on Main'
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/perf-measures
with:
target-ref: 'main'