1414 required : false
1515 type : string
1616 default : ' '
17+ bench_script_compare :
18+ required : false
19+ type : string
20+ default : ' '
1721 runner :
1822 required : false
1923 type : string
@@ -35,14 +39,24 @@ jobs:
3539 runs-on : ${{ inputs.runner }}
3640
3741 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+
3852 - name : Add comment to PR
3953 uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4054 if : ${{ always() && inputs.pr_no != 0 }}
4155 with :
4256 script : |
4357 const pr_no = '${{ inputs.pr_no }}';
4458 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 }}';
4660 const body = `Compute Benchmarks run (with params: ${params}):\n${url}`;
4761
4862 github.rest.issues.createComment({
@@ -145,7 +159,7 @@ jobs:
145159 --output-html remote
146160 --results-dir ${{ github.workspace }}/results-repo
147161 --output-markdown
148- ${{ inputs.bench_script_params }}
162+ ${{ env.bench_params }}
149163
150164 # In case it failed to add a comment, we can still print the results.
151165 - name : Print benchmark results
@@ -168,7 +182,7 @@ jobs:
168182 const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
169183 const test_status = '${{ steps.benchmarks.outcome }}';
170184 const job_status = '${{ job.status }}';
171- const params = '${{ inputs.bench_script_params }}';
185+ const params = '${{ env.bench_params }}';
172186 const body = `Compute Benchmarks run (${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
173187
174188 github.rest.issues.createComment({
0 commit comments