Skip to content

Commit

Permalink
add Google Benchmark Framework workflows for CI and example
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 29, 2019
1 parent b62c24f commit f01cb99
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,36 @@ jobs:
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'Python Benchmark with pytest-benchmark'
google-benchmark-framework:
name: Run Google C++ Benchmark Framework example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: |
cd examples/cpp
make json
- name: Store benchmark result
uses: ./
with:
name: C++ Benchmark with Google Benchmark
tool: 'pytest'
output-file-path: examples/cpp/benchmark_result.json
skip-fetch-gh-pages: true
fail-on-alert: true
- run: node ./scripts/ci_validate_modification.js before_data.js 'C++ Benchmark with Google Benchmark'
only-alert-with-cache:
name: Run alert check with actions/cache
runs-on: ubuntu-latest
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: C++ Example
on:
push:
branches:
- master

jobs:
benchmark:
name: Run C++ benchmark example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run benchmark
run: cd examples/cpp && make json
# TODO: Temporary until new release from here
- uses: actions/setup-node@v1
- run: npm ci
- run: npm run build
# TODO: Temporary until new release until here
- name: Store benchmark result
# TODO: Replace './' with 'rhysd/github-action-benchmark@v1'
uses: ./
with:
name: C++ Benchmark
tool: 'googlecpp'
output-file-path: examples/cpp/benchmark_result.json
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@rhysd'

0 comments on commit f01cb99

Please sign in to comment.