Skip to content

Commit

Permalink
chore: add performance benchmark with hyperfine
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr committed May 19, 2023
1 parent 2079ea6 commit b650185
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/perf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Performance Benchmark

on:
pull_request:
branches:
- main

jobs:
hyperfine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- name: Environments
run: |
echo
echo Using Node $(node -v), NPM $(npm -v)
echo
- name: Install Dependencies
run: npm ci
- name: Install External
run: npm i -g hyperfine @redocly/cli@1.0.0-beta.100
- name: Prepare
run: |
jq '.bin = {"redocly-next":"bin/cli.js"} | .name = "@redocly/cli-next"' packages/cli/package.json > __tmp__.json
mv __tmp__.json packages/cli/package.json
cat packages/cli/package.json
npm run pack:prepare
npm i -g redocly-cli.tgz
- run: redocly-next --version
- run: redocly --version
- name: Run Benchmark
run: hyperfine -i --warmup 3 'redocly lint packages/core/src/benchmark/benches/rebilly.yaml' 'redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml' --export-markdown benchmark_check.md
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: benchmark_check.md
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build and Test

on:
pull_request:
types: [opened, synchronize, reopened]
# pull_request:
# types: [opened, synchronize, reopened]
push:
branches:
- main
Expand Down

0 comments on commit b650185

Please sign in to comment.