39
39
40
40
env :
41
41
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' }}
42
45
43
46
concurrency :
44
47
cancel-in-progress : true
@@ -50,13 +53,13 @@ jobs:
50
53
matrix :
51
54
include :
52
55
- os : ubuntu-latest
53
- additional-task : ' :benchmark:jvmComparisonBenchmark'
56
+ additional-task : " :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationComparisonBenchmark' || ' jvmComparisonBenchmark' }} "
54
57
- os : macos-latest
55
- additional-task : ' -x :benchmark:jvmBenchmark'
58
+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
56
59
- os : macos-13 # for macosX64
57
- additional-task : ' -x :benchmark:jvmBenchmark'
60
+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
58
61
- os : windows-latest
59
- additional-task : ' -x :benchmark:jvmBenchmark'
62
+ additional-task : " -x :benchmark:${{ github.event.pull_request.number && 'jvmPrValidationBenchmark' || ' jvmBenchmark' }} "
60
63
runs-on : ${{ matrix.os }}
61
64
name : Run benchmarks on ${{ matrix.os }}
62
65
env :
89
92
gradle-version : wrapper
90
93
- name : Run benchmarks
91
94
run : >
92
- ./gradlew --no-daemon :benchmark:benchmark ${{ matrix.additional-task }}
95
+ ./gradlew --no-daemon :benchmark:${{ env.MAIN_BENCH_TASK }} ${{ matrix.additional-task }}
93
96
-Pbenchmark_warmups=${{ inputs.warmups }}
94
97
-Pbenchmark_iterations=${{ inputs.iterations }}
95
98
-Pbenchmark_iteration_time=${{ inputs.iteration-time }}
@@ -124,13 +127,13 @@ jobs:
124
127
uses : actions/upload-artifact@v4
125
128
with :
126
129
name : bench-result-${{ matrix.os }}
127
- path : ${{ env.BENCHMARK_RESULTS }}/main /**/*.json
130
+ path : ${{ env.BENCHMARK_RESULTS }}/${{ env.MAIN_BENCH_RESULTS }} /**/*.json
128
131
- name : Store comparison results as artifact
129
132
if : env.REPORT_FORMAT == 'json' && matrix.os == 'ubuntu-latest'
130
133
uses : actions/upload-artifact@v4
131
134
with :
132
135
name : bench-comparison-result-${{ matrix.os }}
133
- path : ${{ env.BENCHMARK_RESULTS }}/comparison /**/*.json
136
+ path : ${{ env.BENCHMARK_RESULTS }}/${{ env.COMPARISON_BENCH_RESULTS }} /**/*.json
134
137
135
138
upload-benchmark-results :
136
139
if : (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'OptimumCode/json-schema-validator'
0 commit comments