@@ -274,9 +274,9 @@ jobs:
274274 format : ' golang'
275275 parallel : true
276276
277- # Integration tests on SQLite backend .
278- integration-test :
279- name : run itests
277+ # Build integration test binaries once, shared by all itest jobs .
278+ build-itest :
279+ name : build itest binaries
280280 runs-on : ubuntu-latest
281281 steps :
282282 - name : git checkout
@@ -290,69 +290,120 @@ jobs:
290290 with :
291291 go-version : ' ${{ env.GO_VERSION }}'
292292
293+ - name : Build itest binaries
294+ run : make build-itest build-itest-binary
295+
296+ - name : Upload itest binaries
297+ uses : actions/upload-artifact@v4
298+ with :
299+ name : itest-binaries
300+ path : |
301+ itest/itest.test
302+ itest/btcd-itest
303+ itest/lnd-itest
304+ itest/chantools/chantools
305+
306+ # Integration tests on SQLite backend.
307+ integration-test :
308+ name : run itests
309+ runs-on : ubuntu-latest
310+ needs : build-itest
311+ strategy :
312+ fail-fast : false
313+ matrix :
314+ tranche : [0, 1, 2, 3]
315+ steps :
316+ - name : git checkout
317+ uses : actions/checkout@v5
318+
319+ - name : Clean up runner space
320+ uses : ./.github/actions/cleanup-space
321+
322+ - name : Download itest binaries
323+ uses : actions/download-artifact@v4
324+ with :
325+ name : itest-binaries
326+ path : itest
327+
328+ - name : Initialize environment
329+ run : |
330+ chmod +x itest/itest.test itest/btcd-itest itest/lnd-itest itest/chantools/chantools
331+ mkdir -p ~/.aperture
332+
293333 - name : run itest
294- run : make itest-parallel
334+ run : scripts/itest_part.sh ${{ matrix.tranche }} 4 0 --verbose
295335
296336 - name : Zip log files on failure
297337 if : ${{ failure() }}
298- run : 7z a logs-itest.zip itest/**/*.log
338+ run : 7z a logs-itest-${{ matrix.tranche }} .zip itest/**/*.log
299339
300340 - name : Upload log files on failure
301341 uses : actions/upload-artifact@v4
302342 if : ${{ failure() }}
303343 with :
304- name : logs-itest
305- path : logs-itest.zip
344+ name : logs-itest-${{ matrix.tranche }}
345+ path : logs-itest-${{ matrix.tranche }} .zip
306346 retention-days : 5
307347
308348 - name : Send coverage
309349 uses : coverallsapp/github-action@v2
310350 if : ${{ success() }}
311351 continue-on-error : true
312352 with :
313- file : itest/coverage.txt
314- flag-name : ' itest'
353+ file : itest/regtest/cover/ coverage-tranche${{ matrix.tranche }} .txt
354+ flag-name : ' itest-${{ matrix.tranche }} '
315355 format : ' golang'
316356 parallel : true
317357
318358 # Integration tests on Postgres backend.
319359 integration-test-postgres :
320360 name : run itests postgres
321361 runs-on : ubuntu-latest
362+ needs : build-itest
363+ strategy :
364+ fail-fast : false
365+ matrix :
366+ tranche : [0, 1, 2, 3]
322367 steps :
323368 - name : git checkout
324369 uses : actions/checkout@v5
325370
326371 - name : Clean up runner space
327372 uses : ./.github/actions/cleanup-space
328373
329- - name : Setup go ${{ env.GO_VERSION }}
330- uses : actions/setup-go@v5
374+ - name : Download itest binaries
375+ uses : actions/download-artifact@v4
331376 with :
332- go-version : ' ${{ env.GO_VERSION }}'
377+ name : itest-binaries
378+ path : itest
379+
380+ - name : Initialize environment
381+ run : |
382+ chmod +x itest/itest.test itest/btcd-itest itest/lnd-itest itest/chantools/chantools
383+ mkdir -p ~/.aperture
333384
334385 - name : run itest
335- run : make itest-parallel dbbackend=postgres tranches=4
386+ run : scripts/itest_part.sh ${{ matrix.tranche }} 4 0 - dbbackend=postgres --verbose
336387
337388 - name : Zip log files on failure
338389 if : ${{ failure() }}
339- run : 7z a logs-itest-postgres.zip itest/**/*.log
390+ run : 7z a logs-itest-postgres-${{ matrix.tranche }} .zip itest/**/*.log
340391
341392 - name : Upload log files on failure
342393 uses : actions/upload-artifact@v4
343394 if : ${{ failure() }}
344395 with :
345- name : logs-itest-postgres
346- path : logs-itest-postgres.zip
396+ name : logs-itest-postgres-${{ matrix.tranche }}
397+ path : logs-itest-postgres-${{ matrix.tranche }} .zip
347398 retention-days : 5
348399
349400 - name : Send coverage
350401 uses : coverallsapp/github-action@v2
351402 if : ${{ success() }}
352403 continue-on-error : true
353404 with :
354- file : itest/coverage.txt
355- flag-name : ' itest'
405+ file : itest/regtest/cover/ coverage-tranche${{ matrix.tranche }} .txt
406+ flag-name : ' itest-postgres-${{ matrix.tranche }} '
356407 format : ' golang'
357408 parallel : true
358409
0 commit comments