Skip to content

Add self-updating badge with commits to snakeyaml-engine #184

Add self-updating badge with commits to snakeyaml-engine

Add self-updating badge with commits to snakeyaml-engine #184

Workflow file for this run

# This file was generated using Kotlin DSL (.github/workflows/benchmark.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Run Benchmarks'
on:
push:
branches:
- 'main'
pull_request: {}
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/benchmark.yaml'' && ''.github/workflows/benchmark.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/benchmark.yaml'''
run-benchmark:
name: 'Performance regression check on ${{ matrix.os }} runner'
runs-on: '${{ matrix.os }}'
needs:
- 'check_yaml_consistency'
strategy:
fail-fast: true
matrix:
include:
- os: 'ubuntu-latest'
- os: 'macos-latest'
additional-args: '-x jvmBenchmark -x jsBenchmark'
- os: 'macos-13'
additional-args: '-x jvmBenchmark -x jsBenchmark'
- os: 'windows-latest'
additional-args: '-x jvmBenchmark -x jsBenchmark'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up Gradle Daemon JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '21'
distribution: 'temurin'
- id: 'step-2'
name: 'Validate Gradle Wrapper'
uses: 'gradle/actions/wrapper-validation@v4'
- id: 'step-3'
name: 'Setup Gradle'
uses: 'gradle/actions/setup-gradle@v4'
with:
gradle-version: 'wrapper'
- id: 'step-4'
name: 'Run benchmarks'
run: './gradlew -p snake-kmp-benchmarks benchmark --no-parallel ${{ matrix.additional-args }}'
- id: 'step-5'
uses: 'actions/upload-artifact@v4'
with:
name: 'bench-results-${{ matrix.os }}'
path: 'snake-kmp-benchmarks/build/reports/benchmarks/main/**/*.json'
collect-benchmarks-results:
runs-on: 'ubuntu-latest'
needs:
- 'run-benchmark'
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Download benchmark results'
uses: 'actions/download-artifact@v4'
with:
path: 'bench-results'
pattern: 'bench-results-*'
merge-multiple: 'true'
- id: 'step-2'
name: 'Prepare and join benchmark reports'
env:
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
run: 'GHWKT_RUN_STEP=''collect-benchmarks-results:step-2'' ''.github/workflows/benchmark.main.kts'''
- id: 'step-3'
name: 'Store benchmark result'
uses: 'benchmark-action/github-action-benchmark@v1'
with:
name: 'SnakeKMP benchmarks'
tool: 'jmh'
output-file-path: 'aggregated.json'
gh-repository: 'github.com/krzema12/snakeyaml-engine-kmp-benchmarks'
github-token: '${{ secrets.PUBLISH_BENCHMARK_RESULTS || github.token }}'
auto-push: '${{ github.repository == ''krzema12/snakeyaml-engine-kmp'' && github.event_name != ''pull_request'' }}'
summary-always: 'true'
comment-on-alert: '${{ github.event.pull_request.head.repo.full_name == ''krzema12/snakeyaml-engine-kmp'' }}'
alert-threshold: '150%'
fail-threshold: '200%'