3939
4040env :
4141 REPORT_FORMAT : ${{ (github.event_name == 'push' || github.event_name == 'pull_request' ) && 'json' || 'csv' }}
42+ MAIN_BENCH_TASK : ${{ github.event.pull_request.number && 'prValidationBenchmark' || 'benchmark' }}
43+ MAIN_BENCH_RESULTS : ${{ github.event.pull_request.number && 'prValidation' || 'main' }}
44+ COMPARISON_BENCH_RESULTS : ${{ github.event.pull_request.number && 'prValidationComparison' || 'comparison' }}
4245
4346concurrency :
4447 cancel-in-progress : true
@@ -50,13 +53,13 @@ jobs:
5053 matrix :
5154 include :
5255 - os : ubuntu-latest
53- additional-task : ' :benchmark:jvmComparisonBenchmark'
56+ additional-task : " :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationComparisonBenchmark' || ' jvmComparisonBenchmark' }} "
5457 - os : macos-latest
55- additional-task : ' -x :benchmark:jvmBenchmark'
58+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
5659 - os : macos-13 # for macosX64
57- additional-task : ' -x :benchmark:jvmBenchmark'
60+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
5861 - os : windows-latest
59- additional-task : ' -x :benchmark:jvmBenchmark'
62+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
6063 runs-on : ${{ matrix.os }}
6164 name : Run benchmarks on ${{ matrix.os }}
6265 env :
8992 gradle-version : wrapper
9093 - name : Run benchmarks
9194 run : >
92- ./gradlew --no-daemon :benchmark:benchmark ${{ matrix.additional-task }}
95+ ./gradlew --no-daemon :benchmark:${{ env.MAIN_BENCH_TASK }} ${{ matrix.additional-task }}
9396 -Pbenchmark_warmups=${{ inputs.warmups }}
9497 -Pbenchmark_iterations=${{ inputs.iterations }}
9598 -Pbenchmark_iteration_time=${{ inputs.iteration-time }}
@@ -124,13 +127,13 @@ jobs:
124127 uses : actions/upload-artifact@v4
125128 with :
126129 name : bench-result-${{ matrix.os }}
127- path : ${{ env.BENCHMARK_RESULTS }}/main /**/*.json
130+ path : ${{ env.BENCHMARK_RESULTS }}/${{ env.MAIN_BENCH_RESULTS }} /**/*.json
128131 - name : Store comparison results as artifact
129132 if : env.REPORT_FORMAT == 'json' && matrix.os == 'ubuntu-latest'
130133 uses : actions/upload-artifact@v4
131134 with :
132135 name : bench-comparison-result-${{ matrix.os }}
133- path : ${{ env.BENCHMARK_RESULTS }}/comparison /**/*.json
136+ path : ${{ env.BENCHMARK_RESULTS }}/${{ env.COMPARISON_BENCH_RESULTS }} /**/*.json
134137
135138 upload-benchmark-results :
136139 if : (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'OptimumCode/json-schema-validator'
0 commit comments