generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from metaplex-foundation/feat/benchmark-summary
Adding benchmark summaries.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Benchmark | ||
on: | ||
workflow_call: | ||
|
||
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@v3 | ||
|
||
- 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 }} | ||
|
||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters