@ -11,7 +11,8 @@ concurrency:
cancel-in-progress : true
env:
GRADLE_OPTS : "-Xmx6g -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true"
GRADLE_OPTS : "-Xmx6g -Dorg.gradle.parallel=true"
total-runners : 8
jobs:
repolint:
@ -75,37 +76,14 @@ jobs:
env:
GRADLEW_UNIT_TEST_ARGS : ${{matrix.gradle_args}}
runs-on : ubuntu-22.04
needs : [ compile ]
needs : [ spotless, gradle-wrapper, repolint ]
permissions:
checks : write
statuses : write
strategy:
fail-fast : true
matrix:
gradle_args:
- "test -x besu:test -x consensus:test -x crypto:test -x ethereum:eth:test -x ethereum:api:test -x ethereum:core:test"
- "besu:test consensus:test crypto:test"
- "ethereum:api:testBonsai"
- "ethereum:api:testForest"
- "ethereum:api:testRemainder"
- "ethereum:eth:test"
- "ethereum:core:test"
#includes will need exact strings from gradle args above
include:
- gradle_args : "test -x besu:test -x consensus:test -x crypto:test -x ethereum:eth:test -x ethereum:api:test -x ethereum:core:test"
filename : "everythingElse"
- gradle_args : "besu:test consensus:test crypto:test"
filename : "consensusCrypto"
- gradle_args : "ethereum:api:testBonsai"
filename : "apiBonsai"
- gradle_args : "ethereum:api:testRemainder"
filename : "apiForest"
- gradle_args : "ethereum:api:testRemainder"
filename : "apiRemainder"
- gradle_args : "ethereum:eth:test"
filename : "eth"
- gradle_args : "ethereum:core:test"
filename : "core"
runner_index : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ]
steps:
- name : Checkout Repo
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
@ -116,22 +94,54 @@ jobs:
with:
distribution : temurin
java-version : 17
- name : Install required packages
run : sudo apt-get install -y xmlstarlet
- name : Setup Gradle
uses : gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1
with:
cache-disabled : true
- name : List unit tests
run : ./gradlew test --test-dry-run -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
- name : Extract current test list
run : mkdir tmp; find . -type f -name TEST-*.xml | xargs -I{} bash -c "xmlstarlet sel -t -v '/testsuite/@name' '{}'; echo '{}' | sed 's#\./\(.*\)/build/test-results/.*# \1#'" | tee tmp/currentTests.list
- name : get unit test reports
uses : dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
branch : main
name_is_regexp : true
name : 'unit-.*-test-results'
path : tmp/junit-xml-reports-downloaded
if_no_artifact_found : true
- name : Split tests
run : .github/workflows/splitTestsByTime.sh tmp/junit-xml-reports-downloaded "tmp/junit-xml-reports-downloaded/unit-.*-test-results" "build/test-results" ${{env.total-runners}} ${{ matrix.runner_index }} > testList.txt
- name : Upload Timing
uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if : matrix.runner_index == 0
with:
name : unit-tests-timing
path : 'tmp/timing.tsv'
- name : Upload Lists
uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if : matrix.runner_index == 0
with:
name : unit-tests-lists
path : 'tmp/*.list'
- name : Upload gradle test tasks
uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name : testList-${{ matrix.runner_index }}.txt
path : testList.txt
- name : run unit tests
id : unitTest
run : ./gradlew $GRADLEW_UNIT_TEST_ARGS
run : cat testList.txt | xargs -P 1 ./gradlew -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
- name : Upload Unit Test Results
uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name : unit-${{matrix.filename}}-test-results
name : unit-${{matrix.runner_index }}-test-results
path : '**/test-results/**/TEST-*.xml'
unittests-passed:
name : "unittests-passed"
runs-on : ubuntu-22.04
needs : [ unitTests]
needs : [ compile, unitTests]
permissions:
checks : write
statuses : write