[POC - 3] New commit interface #1400
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by Flavio W. Brasil's work on Kyo: https://github.com/fwbrasil/kyo | |
name: Benchs | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [ opened, reopened, synchronize ] | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
benchmark: # See https://github.com/marketplace/actions/continuous-benchmark | |
name: Run benchmark | |
runs-on: ubuntu-latest | |
if: ${{ !github.event.pull_request.head.repo.fork }} # comes from https://github.com/orgs/community/discussions/25217#discussioncomment-3246904 | |
steps: | |
- name: Checkout current branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/[email protected] | |
with: | |
distribution: temurin | |
java-version: 17 | |
check-latest: true | |
- name: Use CI sbt jvmopts | |
shell: bash | |
run: | | |
mv .jvmopts .jvmopts_old | |
mv .jvmopts-ci .jvmopts | |
cat .jvmopts | |
- name: compile | |
run: sbt compile | |
- name: run benchmarks | |
# To list all possible options and understand these configurations, see run `sbt "zioKafkaBench/Jmh/run -h"` | |
# | |
# Used options meaning: | |
# - "-wi 5": 5 warmup iterations | |
# - "-i 5": 5 benchmark iterations | |
# - "-r 1": Minimum time to spend at each measurement iteration. 1 second | |
# - "-w 1": Minimum time to spend at each warmup iteration. 1 second | |
# - "-t 1": Number of worker threads to run with. 1 thread | |
# - "-rf json": Format type for machine-readable results. JSON | |
# - "-foe true": Should JMH fail immediately if any benchmark had experienced an unrecoverable error?. True | |
# - "-to 60": 1 minute timeout per iteration | |
run: sbt "zioKafkaBench/Jmh/run -wi 5 -i 5 -r 1 -w 1 -t 1 -to 60 -rf json -foe true" | |
- name: Download previous benchmark data | |
uses: actions/cache@v3 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Rollback - Use CI sbt jvmopts | |
shell: bash | |
run: | | |
mv .jvmopts .jvmopts-ci | |
mv .jvmopts_old .jvmopts | |
cat .jvmopts | |
- name: Store benchmark result | |
uses: benchmark-action/[email protected] | |
with: | |
name: JMH Benchmark | |
tool: 'jmh' | |
output-file-path: zio-kafka-bench/jmh-result.json | |
# Access token to deploy GitHub Pages branch | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Push and deploy GitHub pages branch automatically | |
auto-push: true | |
alert-threshold: '200%' | |
comment-on-alert: true | |
fail-on-alert: true | |
# Mention these maintainers in the commit comment | |
alert-comment-cc-users: '@svroonland,@guizmaii,@erikvanoosten' |