From f01cb9908fe33decfb92a505f0893e0e0ebcaf12 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 29 Nov 2019 18:18:47 +0900 Subject: [PATCH] add Google Benchmark Framework workflows for CI and example --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/cpp.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/cpp.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39b02a4ab..6ee9188b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml new file mode 100644 index 000000000..b819f01b3 --- /dev/null +++ b/.github/workflows/cpp.yml @@ -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'