28
28
DEFAULT_REPOS : " ithacaxyz/account:v0.3.2,Vectorized/solady:v0.1.22"
29
29
30
30
jobs :
31
- setup :
32
- name : Setup and Build
31
+ run-benchmarks :
32
+ name : Run All Benchmarks
33
33
runs-on : foundry-runner
34
34
steps :
35
35
- name : Checkout repository
@@ -59,22 +59,16 @@ jobs:
59
59
- name : Build benchmark binary
60
60
run : cargo build --release --bin foundry-bench
61
61
62
- - name : Upload benchmark binary
63
- uses : actions/upload-artifact @v4
62
+ - name : Setup Node.js
63
+ uses : actions/setup-node @v4
64
64
with :
65
- name : foundry-bench
66
- path : target/release/foundry-bench
67
-
68
- forge-test-bench :
69
- name : Forge Test Benchmarks
70
- needs : setup
71
- runs-on : foundry-runner
72
- steps :
73
- - name : Checkout repository
74
- uses : actions/checkout@v4
65
+ node-version : " 24"
75
66
76
- - name : Benchmark setup
77
- uses : ./.github/actions/benchmark-setup
67
+ - name : Install hyperfine
68
+ run : |
69
+ 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
70
+ sudo mv hyperfine-v1.19.0-x86_64-unknown-linux-gnu/hyperfine /usr/local/bin/
71
+ rm -rf hyperfine-v1.19.0-x86_64-unknown-linux-gnu
78
72
79
73
- name : Run forge test benchmarks
80
74
env :
@@ -83,28 +77,25 @@ jobs:
83
77
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
84
78
REPOS="${{ github.event.inputs.repos || env.DEFAULT_REPOS }}"
85
79
86
- ./foundry-bench --output-dir ./benches --force-install \
80
+ ./target/release/ foundry-bench --output-dir ./benches --force-install \
87
81
--versions $VERSIONS \
88
82
--repos $REPOS \
89
83
--benchmarks forge_test,forge_fuzz_test \
90
84
--output-file forge_test_bench.md
91
85
92
- - name : Upload test benchmark results
93
- uses : actions/upload-artifact@v4
94
- with :
95
- name : forge-test-results
96
- path : benches/forge_test_bench.md
97
-
98
- forge-build-bench :
99
- name : Forge Build Benchmarks
100
- needs : setup
101
- runs-on : foundry-runner
102
- steps :
103
- - name : Checkout repository
104
- uses : actions/checkout@v4
86
+ - name : Run forge isolate test benchmarks
87
+ env :
88
+ FOUNDRY_DIR : ${{ github.workspace }}/.foundry
89
+ run : |
90
+ VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
91
+ # Isolate tests default to Vectorized/solady but can be overridden
92
+ REPOS="${{ github.event.inputs.repos || env.VECTORIZED_SOLADY }}"
105
93
106
- - name : Benchmark setup
107
- uses : ./.github/actions/benchmark-setup
94
+ ./target/release/foundry-bench --output-dir ./benches --force-install \
95
+ --versions $VERSIONS \
96
+ --repos $REPOS \
97
+ --benchmarks forge_isolate_test \
98
+ --output-file forge_isolate_test_bench.md
108
99
109
100
- name : Run forge build benchmarks
110
101
env :
@@ -113,85 +104,76 @@ jobs:
113
104
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
114
105
REPOS="${{ github.event.inputs.repos || env.DEFAULT_REPOS }}"
115
106
116
- ./foundry-bench --output-dir ./benches --force-install \
107
+ ./target/release/ foundry-bench --output-dir ./benches --force-install \
117
108
--versions $VERSIONS \
118
109
--repos $REPOS \
119
110
--benchmarks forge_build_no_cache,forge_build_with_cache \
120
111
--output-file forge_build_bench.md
121
112
122
- - name : Upload build benchmark results
123
- uses : actions/upload-artifact@v4
124
- with :
125
- name : forge-build-results
126
- path : benches/forge_build_bench.md
127
-
128
- forge-coverage-bench :
129
- name : Forge Coverage Benchmarks
130
- needs : setup
131
- runs-on : foundry-runner
132
- steps :
133
- - name : Checkout repository
134
- uses : actions/checkout@v4
135
-
136
- - name : Benchmark setup
137
- uses : ./.github/actions/benchmark-setup
138
-
139
113
- name : Run forge coverage benchmarks
140
114
env :
141
115
FOUNDRY_DIR : ${{ github.workspace }}/.foundry
142
116
run : |
143
117
VERSIONS="${{ github.event.inputs.versions || 'stable,nightly' }}"
144
118
# Coverage only runs on ithacaxyz/account:v0.3.2
145
119
146
- ./foundry-bench --output-dir ./benches --force-install \
120
+ ./target/release/ foundry-bench --output-dir ./benches --force-install \
147
121
--versions $VERSIONS \
148
122
--repos ${{ env.ITHACAXYZ_ACCOUNT }} \
149
123
--benchmarks forge_coverage \
150
124
--output-file forge_coverage_bench.md
151
125
152
- - name : Upload coverage benchmark results
126
+ - name : Combine benchmark results
127
+ run : ./.github/scripts/combine-benchmarks.sh benches
128
+
129
+ - name : Commit and read benchmark results
130
+ id : benchmark_results
131
+ env :
132
+ GITHUB_HEAD_REF : ${{ github.head_ref }}
133
+ run : ./.github/scripts/commit-and-read-benchmarks.sh benches "${{ github.event_name }}" "${{ github.repository }}"
134
+
135
+ - name : Upload benchmark results as artifacts
153
136
uses : actions/upload-artifact@v4
154
137
with :
155
- name : forge-coverage-results
156
- path : benches/forge_coverage_bench.md
157
-
158
- combine-results :
159
- name : Combine and Publish Results
160
- needs : [forge-test-bench, forge-build-bench, forge-coverage-bench]
138
+ name : benchmark-results
139
+ path : |
140
+ benches/forge_test_bench.md
141
+ benches/forge_isolate_test_bench.md
142
+ benches/forge_build_bench.md
143
+ benches/forge_coverage_bench.md
144
+ benches/LATEST.md
145
+
146
+ outputs :
147
+ branch_name : ${{ steps.benchmark_results.outputs.branch_name }}
148
+ pr_comment : ${{ steps.benchmark_results.outputs.pr_comment }}
149
+
150
+ publish-results :
151
+ name : Publish Results
152
+ needs : run-benchmarks
161
153
runs-on : foundry-runner
162
154
steps :
163
155
- name : Checkout repository
164
156
uses : actions/checkout@v4
165
157
166
- - name : Download all benchmark results
158
+ - name : Download benchmark results
167
159
uses : actions/download-artifact@v4
168
160
with :
169
- pattern : forge-* -results
161
+ name : benchmark -results
170
162
path : benches/
171
- merge-multiple : true
172
-
173
- - name : Combine benchmark results
174
- run : ./.github/scripts/combine-benchmarks.sh benches
175
-
176
- - name : Commit and read benchmark results
177
- id : benchmark_results
178
- env :
179
- GITHUB_HEAD_REF : ${{ github.head_ref }}
180
- run : ./.github/scripts/commit-and-read-benchmarks.sh benches "${{ github.event_name }}" "${{ github.repository }}"
181
163
182
164
- name : Push branch for manual runs
183
165
if : github.event_name == 'workflow_dispatch'
184
166
run : |
185
- git push origin "${{ steps.benchmark_results .outputs.branch_name }}"
186
- echo "Pushed branch: ${{ steps.benchmark_results .outputs.branch_name }}"
167
+ git push origin "${{ needs.run-benchmarks .outputs.branch_name }}"
168
+ echo "Pushed branch: ${{ needs.run-benchmarks .outputs.branch_name }}"
187
169
188
170
- name : Create PR for manual runs
189
171
if : github.event_name == 'workflow_dispatch'
190
172
uses : actions/github-script@v7
191
173
with :
192
174
script : |
193
- const branchName = '${{ steps.benchmark_results .outputs.branch_name }}';
194
- const prComment = `${{ steps.benchmark_results .outputs.pr_comment }}`;
175
+ const branchName = '${{ needs.run-benchmarks .outputs.branch_name }}';
176
+ const prComment = `${{ needs.run-benchmarks .outputs.pr_comment }}`;
195
177
196
178
// Create the pull request
197
179
const { data: pr } = await github.rest.pulls.create({
@@ -219,7 +201,7 @@ jobs:
219
201
with :
220
202
script : |
221
203
const prNumber = ${{ github.event.inputs.pr_number || github.event.pull_request.number }};
222
- const prComment = `${{ steps.benchmark_results .outputs.pr_comment }}`;
204
+ const prComment = `${{ needs.run-benchmarks .outputs.pr_comment }}`;
223
205
224
206
const comment = `${prComment}
225
207
0 commit comments