generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 30
81 lines (71 loc) · 2.37 KB
/
benchmark-summary.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
name: Benchmark
on:
workflow_call:
inputs:
git_ref:
type: string
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
# allow posting comments to pull request
pull-requests: write
env:
CACHE: true
jobs:
benchmark_summary:
name: Performance regression summary
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV
- name: Start validator
uses: metaplex-foundation/actions/start-validator@v1
with:
node: 18.x
solana: ${{ env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
artifacts: program-builds-${{ inputs.git_ref }}
- name: Install dependencies
uses: metaplex-foundation/actions/install-node-dependencies@v1
with:
folder: ./clients/js
cache: ${{ env.CACHE }}
key: clients-js
- name: Build
working-directory: ./clients/js
run: pnpm build
- name: Test
working-directory: ./clients/js
run: pnpm bench
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.json came from
tool: "customSmallerIsBetter"
# Where the output from the benchmark tool is stored
output-file-path: ./clients/js/output.json
# Where the previous data file is stored
# external-data-json-path: ./cache/benchmark-data.json
# Enable Job Summary for PRs
summary-always: true
# Always comment on the PR
comment-always: true
# Don't save the benchmark data to the cache
save-data-file: false
# Workflow will fail when an alert happens
fail-on-alert: true
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.GITHUB_TOKEN }}