generated from napi-rs/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 76
87 lines (72 loc) · 2.06 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
name: Benchmark
env:
DEBUG: 'napi:*'
on:
push:
branches:
- main
pull_request:
jobs:
bench:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Bench
runs-on: ubuntu-latest
container:
image: ghcr.io/brooooooklyn/canvas/ubuntu-builder:jammy
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
toolchain: nightly-2023-08-09
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: bench-cargo-cache
- name: Cache yarn
uses: actions/cache@v3
with:
path: .yarn/cache
key: bench-yarn-cache-node-16
- name: Install dependencies
run: yarn install --immutable
- name: Download skia binary
run: |
git config --global --add safe.directory $(pwd)
node ./scripts/release-skia-binary.js --download
- name: 'Build'
run: yarn build
- name: 'Run benchmark'
run: yarn bench
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
if: github.ref == 'refs/heads/main'
with:
tool: 'benchmarkjs'
output-file-path: bench.txt
github-token: ${{ secrets.GH_TOKEN }}
auto-push: true
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
continue-on-error: true
if: github.ref != 'refs/heads/main'
with:
tool: 'benchmarkjs'
output-file-path: bench.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-always: true
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache