@@ -5,54 +5,140 @@ permissions: {}
55 push :
66 branches :
77 - main
8+ pull_request :
9+ branches :
10+ - main
811 workflow_dispatch :
912
1013jobs :
1114 evm-benchmark :
1215 name : EVM Contract Benchmark
1316 runs-on : ubuntu-latest
1417 timeout-minutes : 30
15- permissions :
16- contents : write
17- issues : write
1818 steps :
19- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
19+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
2020 - name : Set up Go
21- uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5 .0
21+ uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2 .0
2222 with :
2323 go-version-file : ./go.mod
2424 - name : Set up Docker Buildx
2525 uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
26+ - name : Install just
27+ uses : extractions/setup-just@v3
2628 - name : Build binaries
27- run : make build-evm build-da
29+ run : just build-evm build-da
2830 - name : Run EVM benchmarks
2931 run : |
3032 cd test/e2e && go test -tags evm -bench=. -benchmem -run='^$' \
3133 -timeout=10m --evm-binary=../../build/evm | tee output.txt
32- - name : Store benchmark result
34+ - name : Run Block Executor benchmarks
35+ run : |
36+ go test -bench=BenchmarkProduceBlock -benchmem -run='^$' \
37+ ./block/internal/executing/... > block_executor_output.txt
38+ - name : Upload benchmark results
39+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
40+ with :
41+ name : evm-benchmark-results
42+ path : |
43+ test/e2e/output.txt
44+ block_executor_output.txt
45+
46+ spamoor-benchmark :
47+ name : Spamoor Trace Benchmark
48+ runs-on : ubuntu-latest
49+ timeout-minutes : 30
50+ steps :
51+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+ - name : Set up Go
53+ uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
54+ with :
55+ go-version-file : ./go.mod
56+ - name : Set up Docker Buildx
57+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
58+ - name : Install just
59+ uses : extractions/setup-just@v3
60+ - name : Build binaries
61+ run : just build-evm build-da
62+ - name : Run Spamoor smoke test
63+ run : |
64+ cd test/e2e && BENCH_JSON_OUTPUT=spamoor_bench.json go test -tags evm \
65+ -run='^TestSpamoorSmoke$' -v -timeout=15m --evm-binary=../../build/evm
66+ - name : Upload benchmark results
67+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
68+ with :
69+ name : spamoor-benchmark-results
70+ path : test/e2e/spamoor_bench.json
71+
72+ # single job to push all results to gh-pages sequentially, avoiding race conditions
73+ publish-benchmarks :
74+ name : Publish Benchmark Results
75+ needs : [evm-benchmark, spamoor-benchmark]
76+ runs-on : ubuntu-latest
77+ permissions :
78+ contents : write
79+ issues : write
80+ pull-requests : write
81+ steps :
82+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
83+ - name : Download EVM benchmark results
84+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
85+ with :
86+ name : evm-benchmark-results
87+ - name : Download Spamoor benchmark results
88+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
89+ with :
90+ name : spamoor-benchmark-results
91+ path : test/e2e/
92+
93+ # only update the benchmark baseline on push/dispatch, not on PRs
94+ - name : Store EVM Contract Roundtrip result
95+ if : always()
3396 uses : benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
3497 with :
3598 name : EVM Contract Roundtrip
3699 tool : ' go'
37100 output-file-path : test/e2e/output.txt
38- auto-push : true
101+ auto-push : ${{ github.event_name != 'pull_request' }}
102+ save-data-file : ${{ github.event_name != 'pull_request' }}
39103 github-token : ${{ secrets.GITHUB_TOKEN }}
40104 alert-threshold : ' 150%'
41105 fail-on-alert : true
42106 comment-on-alert : true
43107
44- - name : Run Block Executor benchmarks
45- run : |
46- go test -bench=BenchmarkProduceBlock -benchmem -run='^$' \
47- ./block/internal/executing/... > block_executor_output.txt
48- - name : Store Block Executor benchmark result
108+ # delete local gh-pages so the next benchmark action step fetches fresh from remote
109+ - name : Reset local gh-pages branch
110+ if : always()
111+ run : git branch -D gh-pages || true
112+
113+ - name : Store Block Executor result
114+ if : always()
49115 uses : benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
50116 with :
51117 name : Block Executor Benchmark
52118 tool : ' go'
53119 output-file-path : block_executor_output.txt
54- auto-push : true
120+ auto-push : ${{ github.event_name != 'pull_request' }}
121+ save-data-file : ${{ github.event_name != 'pull_request' }}
55122 github-token : ${{ secrets.GITHUB_TOKEN }}
56123 alert-threshold : ' 150%'
57124 fail-on-alert : true
58125 comment-on-alert : true
126+
127+ # delete local gh-pages so the next benchmark action step fetches fresh from remote
128+ - name : Reset local gh-pages branch
129+ if : always()
130+ run : git branch -D gh-pages || true
131+
132+ - name : Store Spamoor Trace result
133+ if : always()
134+ uses : benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
135+ with :
136+ name : Spamoor Trace Benchmarks
137+ tool : ' customSmallerIsBetter'
138+ output-file-path : test/e2e/spamoor_bench.json
139+ auto-push : ${{ github.event_name != 'pull_request' }}
140+ save-data-file : ${{ github.event_name != 'pull_request' }}
141+ github-token : ${{ secrets.GITHUB_TOKEN }}
142+ alert-threshold : ' 150%'
143+ fail-on-alert : false
144+ comment-on-alert : true
0 commit comments