-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (106 loc) · 4.04 KB
/
ci.yml
File metadata and controls
130 lines (106 loc) · 4.04 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
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
benchmark:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- name: Collect system information
uses: kenchan0130/actions-system-info@59699597e84e80085a750998045983daa49274c4 # v1.4.0
id: system-info
- name: Print system information
run: |
echo "::group::System Information"
echo "CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
echo "CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
echo "Hostname: ${{ steps.system-info.outputs.hostname }}"
echo "Kernel Release: ${{ steps.system-info.outputs.kernel-release }}"
echo "Kernel Version: ${{ steps.system-info.outputs.kernel-version }}"
echo "OS Name: ${{ steps.system-info.outputs.name }}"
echo "Platform: ${{ steps.system-info.outputs.platform }}"
echo "OS Release: ${{ steps.system-info.outputs.release }}"
echo "Total Memory: ${{ steps.system-info.outputs.totalmem }}"
echo "::endgroup::"
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install hyperfine
uses: taiki-e/install-action@0abfcd587b70a713fdaa7fb502c885e2112acb15 # v2.75.7
with:
tool: hyperfine
- name: Test Vite build
working-directory: apps/10000
run: |
node --run build:vite
ls -lh dist-vite
- name: Test Rsbuild build
working-directory: apps/10000
run: |
node --run build:rsbuild
ls -lh dist-rsbuild
- name: Test Rspack build
working-directory: apps/10000
run: |
node --run build:rspack
ls -lh dist-rspack
- name: Test Rolldown build
working-directory: apps/10000
run: |
node --run build:rolldown
ls -lh dist-rolldown
- name: Test esbuild build
working-directory: apps/10000
run: |
node --run build:esbuild
ls -lh dist-esbuild
- name: Test Bun build
working-directory: apps/10000
run: |
node --run build:bun
ls -lh dist-bun
- name: Run benchmark
run: node bench.mjs --app apps/10000 > benchmark-output.txt
- name: Upload benchmark results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: benchmark-${{ matrix.os }}
path: benchmark-output.txt
update-readme:
needs: benchmark
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.TOKEN }}
- name: Download all benchmark results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ./results
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- name: Update README
run: node scripts/update-readme.mjs
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
commit_message: |-
chore: update benchmark results in README [skip ci]
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
file_pattern: README.md