Skip to content

Commit 98b6f48

Browse files
committed
update
1 parent 61e4633 commit 98b6f48

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
paths:
6+
- 'bench/routers/**/*'
7+
- 'src/**/*'
8+
9+
jobs:
10+
run:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 60
13+
permissions:
14+
contents: write
15+
16+
defaults:
17+
run:
18+
working-directory: ./bench/routers
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
# build
26+
- uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- run: |
31+
cd ..
32+
bun i
33+
bun task build
34+
cd routers
35+
36+
bun i
37+
38+
# bun
39+
- name: bun
40+
continue-on-error: true
41+
run: bun start:bun > results-bun.md
42+
43+
# deno
44+
- uses: denoland/setup-deno@v2.0.3
45+
with:
46+
deno-version: latest
47+
48+
- name: deno
49+
continue-on-error: true
50+
run: bun start:deno > results-deno.md
51+
52+
# node
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: latest
56+
57+
- name: node
58+
continue-on-error: true
59+
run: bun start:node > results-node.md
60+
61+
# Push results
62+
- name: Commit results
63+
run: |
64+
git config user.name "github-actions[bot]"
65+
git config user.email "github-actions[bot]@users.noreply.github.com"
66+
67+
git add .
68+
git commit -m "update micro-benchmark results"
69+
70+
- name: Push with retry
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
for i in {1..10}; do
75+
git pull --rebase origin ${{ github.ref_name }}
76+
77+
if git push origin HEAD:${{ github.ref_name }}; then
78+
echo "Push succeeded"
79+
exit 0
80+
fi
81+
82+
echo "Push failed, retry $i..."
83+
sleep 3
84+
done
85+
86+
echo "Push failed after retries"
87+
exit 1

0 commit comments

Comments
 (0)