Skip to content

Commit

Permalink
Benchmark ci fixes (#840)
Browse files Browse the repository at this point in the history
* update package-lock

* add git stash before github-action-benchmark

* add vm-benchmarks run to PRs

* re-apply git stash to prepare for saving back to cache

* ci: handling exit codes for cases where no changes were made to the git tree

ci: handling exit codes for cases where no changes were made to the git tree

* add same git stash logic to vm-pr

Co-authored-by: Everton Fraga <ev@ethereum.org>
  • Loading branch information
ryanio and evertonfraga authored Aug 25, 2020
1 parent ea73164 commit d08ba7c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/vm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ jobs:
env:
REF: ${{ github.ref }}

# Run git stash in case github-action-benchmark has trouble switching to gh-pages branch due to differing package-locks
- run: git stash

- name: Compare benchmarks
uses: rhysd/github-action-benchmark@v1
with:
Expand All @@ -161,3 +164,9 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy to GitHub pages branch automatically (if on master)
auto-push: ${{ steps.auto_push.outputs.auto_push }}

# Re-apply git stash to prepare for saving back to cache.
# Avoids exit code 1 by checking if there are changes to be stashed first
- run: STASH_LIST=`git stash list` && [ ! -z $STASH_LIST ] && git stash apply || echo "No files to stash-apply. Skipping…"


53 changes: 53 additions & 0 deletions .github/workflows/vm-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,56 @@ jobs:
working-directory: ${{github.workspace}}

- run: npm run test:blockchain -- ${{ matrix.args }} --fork=${{ matrix.fork }}

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 }}

# Run git stash in case github-action-benchmark has trouble switching to gh-pages branch due to differing package-locks
- run: git stash

- 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: 'false'

# Re-apply git stash to prepare for saving back to cache.
# Avoids exit code 1 by checking if there are changes to be stashed first
- run: STASH_LIST=`git stash list` && [ ! -z $STASH_LIST ] && git stash apply || echo "No files to stash-apply. Skipping…"
21 changes: 13 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 comments on commit d08ba7c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: d08ba7c Previous: b402204 Ratio
Block 9422905 2459 ops/sec (±3.24%) 4039 ops/sec (±3.38%) 1.64
Block 9422906 2389 ops/sec (±8.94%) 4008 ops/sec (±5.90%) 1.68
Block 9422907 2206 ops/sec (±9.39%) 3918 ops/sec (±8.83%) 1.78
Block 9422908 2242 ops/sec (±2.56%) 3977 ops/sec (±4.78%) 1.77
Block 9422909 2211 ops/sec (±2.31%) 4017 ops/sec (±1.68%) 1.82
Block 9422910 1847 ops/sec (±15.94%) 3958 ops/sec (±1.41%) 2.14
Block 9422911 2320 ops/sec (±1.63%) 3104 ops/sec (±16.21%) 1.34
Block 9422912 2094 ops/sec (±2.73%) 3770 ops/sec (±1.49%) 1.80
Block 9422913 2129 ops/sec (±2.45%) 3808 ops/sec (±1.39%) 1.79
Block 9422914 2176 ops/sec (±2.07%) 3676 ops/sec (±2.47%) 1.69

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d08ba7c Previous: b402204 Ratio
Block 9422910 1847 ops/sec (±15.94%) 3958 ops/sec (±1.41%) 2.14

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.