forked from yewstack/yew
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 1.87 KB
/
benchmark-ssr.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
---
name: Benchmark - SSR
on:
pull_request:
branches: [master]
paths:
- .github/workflows/benchmark-ssr.yml
- "packages/yew/**"
- "packages/yew-macro/**"
- "packages/yew-router/**"
- "packages/yew-router-macro/**"
- "examples/function_router/**"
- "tools/benchmark-ssr/**"
jobs:
benchmark-ssr:
name: Benchmark - SSR
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
repository: 'yewstack/yew'
ref: master
path: yew-master
- name: Checkout pull request
uses: actions/checkout@v3
with:
path: current-pr
- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
profile: minimal
- name: Restore Rust cache for master
uses: Swatinem/rust-cache@v1
with:
working-directory: yew-master
key: master
- name: Restore Rust cache for current pull request
uses: Swatinem/rust-cache@v1
with:
working-directory: current-pr
key: pr
- name: Run pull request benchmark
run: cargo run --profile=bench --bin benchmark-ssr -- --output-path ./output.json
working-directory: current-pr/tools
- name: Run master benchmark
run: cargo run --profile=bench --bin benchmark-ssr -- --output-path ./output.json
working-directory: yew-master/tools
- name: Write Pull Request ID
run: |
echo "${{ github.event.number }}" > .PR_NUMBER
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: benchmark-ssr
path: |
.PR_NUMBER
yew-master/tools/output.json
current-pr/tools/output.json
retention-days: 1