Skip to content

chore: bump version to 0.8.3-SNAPSHOT #24

chore: bump version to 0.8.3-SNAPSHOT

chore: bump version to 0.8.3-SNAPSHOT #24

Workflow file for this run

name: Benchmarks
on:
workflow_dispatch:
inputs:
database:
description: 'Database to benchmark'
type: choice
options:
- h2
- mysql
- postgresql
default: h2
filter:
description: 'JMH benchmark filter regex'
default: '.*'
push:
branches: [ main ]
paths: [ 'benchmarks/**' ]
permissions:
contents: write
jobs:
benchmark:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: outbox_bench
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: outbox_bench
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
cache: maven
- name: Build benchmarks
run: mvn -B -pl benchmarks -am package -DskipTests
- name: Determine parameters
id: params
env:
INPUT_DATABASE: ${{ inputs.database || 'h2' }}
INPUT_FILTER: ${{ inputs.filter || '.*' }}
run: |
echo "database=$INPUT_DATABASE" >> "$GITHUB_OUTPUT"
echo "filter=$INPUT_FILTER" >> "$GITHUB_OUTPUT"
- name: Run JMH benchmarks
env:
BENCH_DATABASE: ${{ steps.params.outputs.database }}
BENCH_FILTER: ${{ steps.params.outputs.filter }}
run: |
java \
-Dbench.mysql.password=root \
-Dbench.pg.password=postgres \
-jar benchmarks/target/benchmarks.jar \
-p "database=$BENCH_DATABASE" \
-wi 2 -i 3 -f 1 \
-rf json -rff benchmarks/target/jmh-result.json \
"$BENCH_FILTER"
- name: Upload benchmark results
uses: actions/upload-artifact@v6
with:
name: jmh-results-${{ steps.params.outputs.database }}
path: benchmarks/target/jmh-result.json
- name: Store benchmark result (push to main only)
if: github.event_name == 'push'
uses: benchmark-action/github-action-benchmark@v1
with:
tool: jmh
output-file-path: benchmarks/target/jmh-result.json
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: false