@@ -146,10 +146,76 @@ jobs:
146146 if : matrix.test-set == 'no-thunks-safe'
147147 run : cabal test ouroboros-consensus:consensus-test ouroboros-consensus:doctest ouroboros-consensus:infra-test ouroboros-consensus:storage-test ouroboros-consensus-cardano:byron-test ouroboros-consensus-cardano:shelley-test ouroboros-consensus-diffusion:infra-test ouroboros-consensus-protocol:protocol-test -j --test-show-details=streaming
148148
149+ - name : Identify benchmark executables
150+ run : |
151+ cp $(cabal list-bin mempool-bench) mempool-bench
152+
153+ - name : Upload benchmark executables
154+ uses : actions/upload-artifact@v4
155+ with :
156+ name : benchmark-exes-${{ runner.os }}-${{ matrix.ghc }}
157+ path : mempool-bench
158+ retention-days : 1
159+
160+ # NB: build the haddocks at the end to avoid unecessary recompilations.
161+ # We build the haddocks only for one GHC version.
162+ - name : Build Haddock documentation
163+ if : |
164+ github.event_name == 'push'
165+ && github.ref == 'refs/heads/main'
166+ && matrix.ghc=='9.6.6'
167+ run : |
168+ # need for latex, dvisvgm and standalone
169+ sudo apt install texlive-latex-extra texlive-latex-base
170+ # cabal-docspec doesn't work with XDG https://github.com/phadej/cabal-extras/issues/136
171+ sed -i 's_-- store-dir:_store-dir: /home/runner/.local/state/cabal/store_g' ~/.config/cabal/config
172+ export CABAL_CONFIG=~/.config/cabal/config
173+
174+ ./scripts/docs/haddocks.sh
175+ tar vzcf haddocks.tgz ./docs/website/static/haddocks
176+
177+ - name : Upload haddocks as an artifact
178+ if : |
179+ github.event_name == 'push'
180+ && github.ref == 'refs/heads/main'
181+ && matrix.ghc=='9.6.6'
182+ uses : actions/upload-artifact@v4
183+ with :
184+ name : haddocks
185+ path : haddocks.tgz
186+ retention-days : 1
187+
188+ benchmarks :
189+ name : Run benchmarks
190+ needs : build-test-bench-haddocks
191+
192+ runs-on : ubuntu-latest
193+ strategy :
194+ fail-fast : false
195+ matrix :
196+ ghc : ["8.10.7", "9.6.6", "9.10.1"]
197+
198+ steps :
199+ - uses : actions/checkout@v4
200+
201+ - name : Install base libraries
202+ uses : input-output-hk/actions/base@latest
203+ with :
204+ use-sodium-vrf : false
205+
206+ - name : Download benchmark executables
207+ uses : actions/download-artifact@v4
208+ with :
209+ name : benchmark-exes-${{ runner.os }}-${{ matrix.ghc }}
210+
211+ - name : Set permissions for benchmark executables
212+ run : |
213+ chmod u+x mempool-bench
214+
149215 - name : Create baseline-benchmark
150216 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
151217 run : |
152- cabal new-run ouroboros-consensus: mempool-bench -- \
218+ ./ mempool-bench \
153219 --timeout=60 --csv mempool-benchmarks.csv \
154220 +RTS -T
155221
@@ -163,7 +229,6 @@ jobs:
163229 # then we will save the same results we just restored.
164230 - name : Cache benchmark baseline results
165231 uses : actions/cache@v4
166- if : matrix.variant == 'default'
167232 with :
168233 path : baseline-mempool-benchmarks.csv
169234 key : baseline-mempool-benchmarks-${{ runner.os }}-${{ matrix.ghc }}-${{ github.run_id }}
@@ -188,7 +253,7 @@ jobs:
188253 if : ${{ github.event_name == 'pull_request' }}
189254 run : |
190255 if [ -f baseline-mempool-benchmarks.csv ]; then
191- cabal new-run ouroboros-consensus: mempool-bench -- \
256+ ./ mempool-bench \
192257 --timeout=60 --baseline baseline-mempool-benchmarks.csv \
193258 --fail-if-slower 100 \
194259 +RTS -T
@@ -197,34 +262,6 @@ jobs:
197262 echo "Benchmarks comparison skipped."
198263 fi
199264
200- # NB: build the haddocks at the end to avoid unecessary recompilations.
201- # We build the haddocks only for one GHC version.
202- - name : Build Haddock documentation
203- if : |
204- github.event_name == 'push'
205- && github.ref == 'refs/heads/main'
206- && matrix.ghc=='9.6.6'
207- run : |
208- # need for latex, dvisvgm and standalone
209- sudo apt install texlive-latex-extra texlive-latex-base
210- # cabal-docspec doesn't work with XDG https://github.com/phadej/cabal-extras/issues/136
211- sed -i 's_-- store-dir:_store-dir: /home/runner/.local/state/cabal/store_g' ~/.config/cabal/config
212- export CABAL_CONFIG=~/.config/cabal/config
213-
214- ./scripts/docs/haddocks.sh
215- tar vzcf haddocks.tgz ./docs/website/static/haddocks
216-
217- - name : Upload haddocks as an artifact
218- if : |
219- github.event_name == 'push'
220- && github.ref == 'refs/heads/main'
221- && matrix.ghc=='9.6.6'
222- uses : actions/upload-artifact@v4
223- with :
224- name : haddocks
225- path : haddocks.tgz
226- retention-days : 1
227-
228265 deploy-documentation :
229266 name : Deploy documentation to GitHub Pages
230267 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
0 commit comments