@@ -5,10 +5,6 @@ permissions: {}
55on :
66 workflow_dispatch :
77 inputs :
8- pr_number :
9- description : " PR number to comment on (optional)"
10- required : false
11- type : string
128 versions :
139 description : " Comma-separated list of Foundry versions to benchmark (optional, defaults to 'v1.5.1,v1.7.0')"
1410 required : false
8884 - name : Build benchmark binary
8985 run : cargo build --locked --release --bin foundry-bench
9086
91- - name : Setup Node.js
92- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
93- with :
94- node-version : " 24"
95-
9687 - name : Install hyperfine
9788 run : |
9889 curl -L https://github.com/sharkdp/hyperfine/releases/download/v1.19.0/hyperfine-v1.19.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
@@ -118,7 +109,7 @@ jobs:
118109 VERSIONS : ${{ github.event.inputs.versions || env.DEFAULT_VERSIONS }}
119110 REPOS : ${{ github.event.inputs.repos || env.ISOLATE_TEST_REPOS }}
120111 run : |
121- ./target/release/foundry-bench --output-dir ./benches --force-install \
112+ ./target/release/foundry-bench --output-dir ./benches \
122113 --versions "$VERSIONS" \
123114 --repos "$REPOS" \
124115 --benchmarks forge_isolate_test \
@@ -131,7 +122,7 @@ jobs:
131122 VERSIONS : ${{ github.event.inputs.versions || env.DEFAULT_VERSIONS }}
132123 REPOS : ${{ github.event.inputs.repos || env.BUILD_REPOS }}
133124 run : |
134- ./target/release/foundry-bench --output-dir ./benches --force-install \
125+ ./target/release/foundry-bench --output-dir ./benches \
135126 --versions "$VERSIONS" \
136127 --repos "$REPOS" \
137128 --benchmarks forge_build_no_cache,forge_build_with_cache \
@@ -144,7 +135,7 @@ jobs:
144135 VERSIONS : ${{ github.event.inputs.versions || env.DEFAULT_VERSIONS }}
145136 REPOS : ${{ github.event.inputs.repos || env.COVERAGE_REPOS }}
146137 run : |
147- ./target/release/foundry-bench --output-dir ./benches --force-install \
138+ ./target/release/foundry-bench --output-dir ./benches \
148139 --versions "$VERSIONS" \
149140 --repos "$REPOS" \
150141 --benchmarks forge_coverage \
@@ -154,10 +145,6 @@ jobs:
154145 - name : Combine benchmark results
155146 run : ./.github/scripts/combine-benchmarks.sh benches
156147
157- - name : Read benchmark results
158- id : benchmark_results
159- run : ./.github/scripts/read-benchmark-results.sh benches
160-
161148 - name : Upload benchmark results as artifacts
162149 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
163150 with :
@@ -169,9 +156,6 @@ jobs:
169156 benches/forge_coverage_bench.md
170157 benches/LATEST.md
171158
172- outputs :
173- pr_comment : ${{ steps.benchmark_results.outputs.pr_comment }}
174-
175159 publish-results :
176160 name : Publish Results
177161 needs : run-benchmarks
@@ -181,6 +165,7 @@ jobs:
181165 permissions :
182166 contents : write
183167 pull-requests : write
168+
184169 steps :
185170 - name : Checkout repository
186171 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -203,13 +188,10 @@ jobs:
203188 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
204189 env :
205190 BRANCH_NAME : ${{ steps.commit_results.outputs.branch_name }}
206- PR_COMMENT : ${{ needs.run-benchmarks.outputs.pr_comment }}
207191 with :
208192 script : |
209193 const branchName = process.env.BRANCH_NAME;
210- const prComment = process.env.PR_COMMENT;
211194
212- // Create the pull request
213195 const { data: pr } = await github.rest.pulls.create({
214196 owner: context.repo.owner,
215197 repo: context.repo.repo,
@@ -220,36 +202,9 @@ jobs:
220202
221203 This PR contains the latest benchmark results from a manual workflow run.
222204
223- ${prComment}
224-
225205 ---
226206
227207 🤖 This PR was automatically generated by the [Foundry Benchmarks workflow](https://github.com/${{ github.repository }}/actions).`
228208 });
229209
230210 console.log(`Created PR #${pr.number}: ${pr.html_url}`);
231-
232- - name : Comment on PR
233- if : github.event.inputs.pr_number != '' || github.event_name == 'pull_request'
234- uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
235- env :
236- PR_COMMENT : ${{ needs.run-benchmarks.outputs.pr_comment }}
237- with :
238- script : |
239- const prNumber = ${{ github.event.inputs.pr_number || github.event.pull_request.number }};
240- const prComment = process.env.PR_COMMENT;
241-
242- const comment = `${prComment}
243-
244- ---
245-
246- 🤖 This comment was automatically generated by the [Foundry Benchmarks workflow](https://github.com/${{ github.repository }}/actions).
247-
248- To run benchmarks manually: Go to [Actions](https://github.com/${{ github.repository }}/actions/workflows/benchmarks.yml) → "Run workflow"`;
249-
250- github.rest.issues.createComment({
251- issue_number: prNumber,
252- owner: context.repo.owner,
253- repo: context.repo.repo,
254- body: comment
255- });
0 commit comments