Skip to content

Commit

Permalink
Merge pull request #200 from metaplex-foundation/feat/benchmark-summary
Browse files Browse the repository at this point in the history
Adding benchmark summaries.
  • Loading branch information
blockiosaurus authored Dec 6, 2024
2 parents f15e284 + 7daf9d0 commit 729fde8
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/benchmark-summary.yml
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 }}
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ jobs:
uses: ./.github/workflows/benchmark.yml
secrets: inherit

benchmark_summary:
if: ${{ github.event_name == 'pull_request' }}
name: Benchmark Summary
needs: generate_clients
uses: ./.github/workflows/benchmark-summary.yml
secrets: inherit

build_rust_client:
if: needs.changes.outputs.rust_client == 'true'
name: Rust Client
Expand Down

0 comments on commit 729fde8

Please sign in to comment.