Skip to content

Commit

Permalink
Merge pull request #830 from ethereumjs/vm/benchmark-js
Browse files Browse the repository at this point in the history
Use benchmark.js
  • Loading branch information
holgerd77 authored Aug 19, 2020
2 parents 3942a09 + cc7b107 commit afb9641
Show file tree
Hide file tree
Showing 8 changed files with 459 additions and 239,570 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/vm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,61 @@ jobs:
working-directory: ${{github.workspace}}

- run: npm run test:blockchain

vm-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v2

- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
working-directory: ${{github.workspace}}

- run: npm run build:benchmarks
working-directory: ${{ env.cwd }}

- run: npm run benchmarks -- 10 | tee output.txt
working-directory: ${{ env.cwd }}

- name: Set auto-push for benchmarks to true if on master
id: auto_push
run: |
if [$REF == 'refs/heads/master']
then
echo "::set-output name=auto_push::true"
else
echo "::set-output name=auto_push::false"
fi
env:
REF: ${{ github.ref }}

- name: Compare benchmarks
uses: rhysd/github-action-benchmark@v1
with:
tool: 'benchmarkjs'
# Where the output from the benchmark tool is stored
output-file-path: ${{ env.cwd }}/output.txt
# Enable alert commit comment
comment-on-alert: true
# Always leave a commit comment comparing the current benchmark with previous
comment-always: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy to GitHub pages branch automatically (if on master)
auto-push: ${{ steps.auto_push.outputs.auto_push }}
Loading

0 comments on commit afb9641

Please sign in to comment.