-
Notifications
You must be signed in to change notification settings - Fork 87
94 lines (88 loc) · 3.67 KB
/
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
name: Benchmarks
on:
push:
branches:
- main
jobs:
benchmark:
name: Benchmark Wasm bundle sizes
runs-on: ubuntu-latest
strategy:
matrix:
include:
# For now, we list all the examples we're testing, but in future this will be automatic
- name: basic
type: core
# - name: freezing_and_thawing
# type: core
# - name: global_state
# type: core
# - name: i18n
# type: core
# - name: idb_freezing
# type: core
# - name: plugins
# type: core
# - name: router_state
# type: core
# - name: rx_state
# type: core
# - name: set_headers
# type: core
# - name: state_generation
# type: core
# - name: static_content
# type: core
# - name: unreactive
# type: core
# - name: index_view
# type: core
# - name: custom_server
# type: core
steps:
- uses: actions/checkout@v2
# Cache Cargo binaries
- uses: actions/cache@v3
id: cache
with:
path: |
~/.cargo/bin/
# The cache should be OS-specific
key: ${{ runner.os }}-cargo-bins
# Only install the binaries if the cache doesn't have them
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cargo install bonnie rust-script
# Also cache all the other Cargo files, since plenty of CI runs won't involve different dependencies
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Run benchmark for ${{ matrix.name }} in category ${{ matrix.type }}
run: bonnie bench size ${{ matrix.type }} ${{ matrix.name }} --json | tee output.txt
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: "customSmallerIsBetter"
# Where the output from the benchmark tool is stored
output-file-path: output.txt
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark-data.json
# Workflow will fail when an alert happens
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: "110%"
comment-on-alert: true
alert-comment-cc-users: '@arctic-hen7' # We need this kind of quoting, `@` is special in YAML