14
14
required : false
15
15
type : string
16
16
default : ' '
17
+ bench_script_compare :
18
+ required : false
19
+ type : string
20
+ default : ' '
17
21
runner :
18
22
required : false
19
23
type : string
@@ -35,14 +39,24 @@ jobs:
35
39
runs-on : ${{ inputs.runner }}
36
40
37
41
steps :
42
+ - name : Establish bench params
43
+ run : |
44
+ params="${{ inputs.bench_script_params }}"
45
+ if [ -n "${{ inputs.bench_script_compare }}" ]; then
46
+ params="$params --compare '${{ inputs.bench_script_compare }}'"
47
+ fi
48
+
49
+ echo "params=$params"
50
+ echo "bench_params=$params" >> $GITHUB_ENV
51
+
38
52
- name : Add comment to PR
39
53
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
40
54
if : ${{ always() && inputs.pr_no != 0 }}
41
55
with :
42
56
script : |
43
57
const pr_no = '${{ inputs.pr_no }}';
44
58
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
45
- const params = '${{ inputs.bench_script_params }}';
59
+ const params = '${{ env.bench_params }}';
46
60
const body = `Compute Benchmarks run (with params: ${params}):\n${url}`;
47
61
48
62
github.rest.issues.createComment({
@@ -145,7 +159,7 @@ jobs:
145
159
--output-html remote
146
160
--results-dir ${{ github.workspace }}/results-repo
147
161
--output-markdown
148
- ${{ inputs.bench_script_params }}
162
+ ${{ env.bench_params }}
149
163
150
164
# In case it failed to add a comment, we can still print the results.
151
165
- name : Print benchmark results
@@ -168,7 +182,7 @@ jobs:
168
182
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
169
183
const test_status = '${{ steps.benchmarks.outcome }}';
170
184
const job_status = '${{ job.status }}';
171
- const params = '${{ inputs.bench_script_params }}';
185
+ const params = '${{ env.bench_params }}';
172
186
const body = `Compute Benchmarks run (${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
173
187
174
188
github.rest.issues.createComment({
0 commit comments