Skip to content

Commit 81d5716

Browse files
committed
Generate benchmark summary and add it to the job
1 parent 64da382 commit 81d5716

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/platform-benchmark.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,25 @@ on:
2929
default: 's'
3030
type: string
3131
required: false
32+
report-format:
33+
description: 'format of the report'
34+
default: 'csv'
35+
type: string
36+
required: false
3237

3338
jobs:
3439
benchmark:
3540
runs-on: ${{ inputs.run-on }}
3641
steps:
3742
- name: 'Checkout Repository'
3843
uses: actions/checkout@v4
39-
with:
40-
submodules: true
4144
- uses: actions/setup-java@v4
4245
with:
4346
distribution: temurin
4447
java-version-file: .ci-java-version
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version-file: .ci-python-version
4551
- name: Validate Gradle Wrapper
4652
uses: gradle/wrapper-validation-action@v2
4753
- name: Cache konan
@@ -57,8 +63,21 @@ jobs:
5763
gradle-version: wrapper
5864
- name: Run benchmarks
5965
run: >
60-
./gradlew --no-daemon --info :benchmark:benchmark ${{ inputs.additional-task }}
66+
./gradlew --no-daemon :benchmark:benchmark ${{ inputs.additional-task }}
6167
-Pbenchmark_warmups=${{ inputs.warmups }}
6268
-Pbenchmark_iterations=${{ inputs.iterations }}
6369
-Pbenchmark_iteration_time=${{ inputs.iteration-time }}
64-
-Pbenchmark_iteration_time_unit=${{ inputs.iteration-time-unit }}
70+
-Pbenchmark_iteration_time_unit=${{ inputs.iteration-time-unit }}
71+
-Pbenchmark_report_format=${{ inputs.report-format }}
72+
- name: Install CSV to MD converter
73+
run: pip install csv2md
74+
- name: Add benchmark results to summary
75+
shell: bash
76+
run: |
77+
for report in $(find ./benchmark/build/reports/benchmarks/main -type f -name "*.csv")
78+
do
79+
file_name=$(basename "$report")
80+
platform="${file_name%.*}"
81+
echo "# Platform ${platform}" >> $GITHUB_STEP_SUMMARY
82+
csv2md "$report" >> $GITHUB_STEP_SUMMARY
83+
done

.github/workflows/snapshot_release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths-ignore:
88
- 'README.md'
9+
- 'benchmark/*'
910

1011
jobs:
1112
publish:

benchmark/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ benchmark {
6060
iterations = properties["benchmark_iterations"]?.takeIfNotBlank()?.toInt() ?: 10
6161
iterationTime = properties["benchmark_iteration_time"]?.takeIfNotBlank()?.toLong() ?: 1L
6262
iterationTimeUnit = properties["benchmark_iteration_time_unit"]?.takeIfNotBlank() ?: "s"
63+
reportFormat = properties["benchmark_report_format"]?.takeIfNotBlank() ?: "json"
6364
param("objectPath", "$projectDir/data/openapi.json")
6465
param("schemaPath", "$projectDir/data/schemas/openapi_schema.json")
6566
}

0 commit comments

Comments
 (0)