Skip to content

feat: add a new command to compare multiple benchmark results #157

feat: add a new command to compare multiple benchmark results

feat: add a new command to compare multiple benchmark results #157

Workflow file for this run

name: Benchmark
# only one can tun at a time.
# Actions access a common cache entry and may corrupt it.
concurrency: cd-benchmark-${{ github.ref }}
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
local:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Get the entire git history to walk commit history on head branch
fetch-depth: 0
# Do not checkout merge commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v2-beta
with:
node-version: "18"
- name: Install
run: yarn install --frozen-lockfile
# Run benchmark with custom tooling and stores the output to a file
- name: Run performance tests
# actions/cache@v2 will not persist data if the job fails.
# On push don't throw to persist benchmark data
run: yarn benchmark --local ./cache --noThrow ${{ github.event_name == 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Currently not working, see https://github.com/actions/toolkit/issues/852
###########
# ga-cache:
# if: always()
# runs-on: ubuntu-latest
# # Ensure both don't run at the same time
# needs: [local]
# steps:
# - uses: actions/checkout@v2
# with:
# # Get the entire git history to walk commit history on head branch
# fetch-depth: 0
# # Do not checkout merge commit
# ref: ${{ github.event.pull_request.head.sha }}
# - uses: actions/setup-node@v2-beta
# with:
# node-version: "14.16.0"
# - name: Install
# run: yarn install --frozen-lockfile
# # Run benchmark with custom tooling and stores the output to a file
# - name: Run performance tests
# run: yarn benchmark --ga-cache ${{ runner.os }}-benchmark-data
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
s3:
if: always()
runs-on: ubuntu-latest
# Ensure both don't run at the same time
needs:
- local
# - ga-cache
steps:
- uses: actions/checkout@v2
with:
# Get the entire git history to walk commit history on head branch
fetch-depth: 0
# Do not checkout merge commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v2-beta
with:
node-version: "18"
- name: Install
run: yarn install --frozen-lockfile
# Run benchmark with custom tooling and stores the output to a file
- name: Run performance tests
run: yarn benchmark --s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# S3 credentials
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
S3_REGION: ${{ secrets.S3_REGION }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
# Key prefix to separate benchmark data from multiple repositories
S3_KEY_PREFIX: ${{ github.repository }}/${{ runner.os }}