@@ -142,18 +142,80 @@ jobs:
142142 if : matrix.test-set == 'all'
143143 run : cabal test all -j --test-show-details=streaming
144144
145- - name : Test (NoThunks-safe tests only, part 1 )
145+ - name : Test (NoThunks-safe tests only)
146146 if : matrix.test-set == 'no-thunks-safe'
147- run : cabal test ouroboros-consensus:consensus-test ouroboros-consensus:doctest ouroboros-consensus:infra-test ouroboros-consensus:storage-test ouroboros-consensus-cardano:byron-test -j --test-show-details=streaming
147+ 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 : Test (NoThunks-safe tests only, part 2)
150- if : matrix.test-set == 'no-thunks-safe'
151- run : cabal test ouroboros-consensus-cardano:shelley-test ouroboros-consensus-diffusion:infra-test ouroboros-consensus-diffusion:mock-test ouroboros-consensus-protocol:protocol-test -j --test-show-details=streaming
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 : 10
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
152214
153215 - name : Create baseline-benchmark
154216 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
155217 run : |
156- cabal new-run ouroboros-consensus: mempool-bench -- \
218+ ./ mempool-bench \
157219 --timeout=60 --csv mempool-benchmarks.csv \
158220 +RTS -T
159221
@@ -167,7 +229,6 @@ jobs:
167229 # then we will save the same results we just restored.
168230 - name : Cache benchmark baseline results
169231 uses : actions/cache@v4
170- if : matrix.variant == 'default'
171232 with :
172233 path : baseline-mempool-benchmarks.csv
173234 key : baseline-mempool-benchmarks-${{ runner.os }}-${{ matrix.ghc }}-${{ github.run_id }}
@@ -192,7 +253,7 @@ jobs:
192253 if : ${{ github.event_name == 'pull_request' }}
193254 run : |
194255 if [ -f baseline-mempool-benchmarks.csv ]; then
195- cabal new-run ouroboros-consensus: mempool-bench -- \
256+ ./ mempool-bench \
196257 --timeout=60 --baseline baseline-mempool-benchmarks.csv \
197258 --fail-if-slower 100 \
198259 +RTS -T
@@ -201,34 +262,6 @@ jobs:
201262 echo "Benchmarks comparison skipped."
202263 fi
203264
204- # NB: build the haddocks at the end to avoid unecessary recompilations.
205- # We build the haddocks only for one GHC version.
206- - name : Build Haddock documentation
207- if : |
208- github.event_name == 'push'
209- && github.ref == 'refs/heads/main'
210- && matrix.ghc=='9.6.6'
211- run : |
212- # need for latex, dvisvgm and standalone
213- sudo apt install texlive-latex-extra texlive-latex-base
214- # cabal-docspec doesn't work with XDG https://github.com/phadej/cabal-extras/issues/136
215- sed -i 's_-- store-dir:_store-dir: /home/runner/.local/state/cabal/store_g' ~/.config/cabal/config
216- export CABAL_CONFIG=~/.config/cabal/config
217-
218- ./scripts/docs/haddocks.sh
219- tar vzcf haddocks.tgz ./docs/website/static/haddocks
220-
221- - name : Upload haddocks as an artifact
222- if : |
223- github.event_name == 'push'
224- && github.ref == 'refs/heads/main'
225- && matrix.ghc=='9.6.6'
226- uses : actions/upload-artifact@v4
227- with :
228- name : haddocks
229- path : haddocks.tgz
230- retention-days : 1
231-
232265 deploy-documentation :
233266 name : Deploy documentation to GitHub Pages
234267 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -248,7 +281,7 @@ jobs:
248281 cache : yarn
249282 cache-dependency-path : ' ./docs/website/yarn.lock'
250283
251- - uses : cachix/install-nix-action@V27
284+ - uses : cachix/install-nix-action@v29
252285 with :
253286 extra_nix_config : |
254287 accept-flake-config = true
0 commit comments