-
Notifications
You must be signed in to change notification settings - Fork 153
127 lines (104 loc) · 4.06 KB
/
js_framework_bench.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
name: JS framework benchmark
on:
pull_request:
branches: [main]
types: [labeled, synchronize]
jobs:
js-bench:
name: JS framework benchmark
runs-on: ubuntu-latest
if: >-
(github.event.action == 'labeled' && github.event.label.name == 'performance') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name,
'performance'))
steps:
# Install necessary tooling
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install trunk
run: >
wget -qO-
https://github.com/thedodd/trunk/releases/download/v0.21.1/trunk-x86_64-unknown-linux-gnu.tar.gz
| tar -xzf- && sudo mv trunk /usr/bin/
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
with:
install-chromedriver: true
# Checkout repositories into respective directories
- uses: actions/checkout@v4
with:
path: ./sycamore
- uses: actions/checkout@v4
with:
path: ./sycamore-baseline
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/checkout@v4
with:
repository: krausest/js-framework-benchmark
path: ./js-framework-benchmark
# Prepare the environment for running the benchmarks
- name: Delete all frameworks in js-framework-benchmark except for wasm-bindgen
run: |
mv ./js-framework-benchmark/frameworks/keyed/wasm-bindgen ./tmp
rm -rf ./js-framework-benchmark/frameworks/keyed/*
rm -rf ./js-framework-benchmark/frameworks/non-keyed/*
mv ./tmp ./js-framework-benchmark/frameworks/keyed/wasm-bindgen
- name: Configure benchmarks
run: node ./sycamore/packages/tools/configure_bench.js
- name: Benchmark list
run: |
ls ./js-framework-benchmark/frameworks/keyed
ls ./js-framework-benchmark/frameworks/keyed/sycamore
ls ./js-framework-benchmark/frameworks/keyed/sycamore-baseline
- name: Install js-framework-benchmark dependencies
run: |
cd ./js-framework-benchmark
npm ci
(cd server && npm ci)
(cd webdriver-ts && npm ci)
(cd webdriver-ts-results && npm ci)
(cd frameworks/keyed/sycamore && npm install)
(cd frameworks/keyed/sycamore-baseline && npm install)
- name: Start server
run: cd ./js-framework-benchmark && npm start &
- name: Build benchmark driver
run: cd ./js-framework-benchmark/webdriver-ts && npm run compile
- name: Run benchmark
run: cd ./js-framework-benchmark && npm run bench -- --headless --framework keyed/sycamore keyed/sycamore-baseline keyed/wasm-bindgen
- name: Results
run: cd ./js-framework-benchmark && npm run results
- name: Upload results JSON
uses: actions/upload-artifact@v3
with:
name: results-json
path: js-framework-benchmark/webdriver-ts/results.json
- name: Upload results HTML
uses: actions/upload-artifact@v3
with:
name: results-html
path: js-framework-benchmark/webdriver-ts-results/dist
- name: Log results
run: |
results=$(cd ./sycamore/packages/tools/bench-diff && cargo run -- ../../../../js-framework-benchmark/webdriver-ts/results.json)
echo "$results"
mkdir bench-results
echo "$results" &> bench-results/BENCH_RESULTS.txt
- name: Log PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: echo "$PR_NUMBER" &> bench-results/PR_NUMBER.txt
- name: Upload bench diff
uses: actions/upload-artifact@v3
with:
name: bench-results
path: bench-results
retention-days: 1