|
|
|
name: acceptance-tests
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- release-*
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
GRADLE_OPTS: "-Xmx6g"
|
|
|
|
total-runners: 16
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
acceptanceTestEthereum:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
name: "Acceptance Runner"
|
|
|
|
permissions:
|
|
|
|
statuses: write
|
|
|
|
checks: write
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
runner_index: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
|
|
|
- name: Set up Java
|
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
- name: Install required packages
|
|
|
|
run: sudo apt-get install -y xmlstarlet
|
|
|
|
- name: get acceptance test report
|
|
|
|
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
|
|
|
|
with:
|
|
|
|
branch: main
|
|
|
|
name_is_regexp: true
|
|
|
|
name: 'acceptance-node-\d*\d-test-results'
|
|
|
|
path: tmp/junit-xml-reports-downloaded
|
|
|
|
if_no_artifact_found: true
|
|
|
|
- name: setup gradle
|
|
|
|
uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1
|
|
|
|
with:
|
|
|
|
cache-disabled: true
|
|
|
|
- name: Compile acceptance tests
|
|
|
|
run: ./gradlew :acceptance-tests:tests:testClasses
|
|
|
|
- name: List acceptance tests
|
|
|
|
run: ./gradlew :acceptance-tests:tests:listAcceptanceTestNotPrivacy -Dorg.gradle.caching=true | fgrep org.hyperledger.besu.tests.acceptance > tmp/currentTests.list
|
|
|
|
- name: Split tests
|
|
|
|
run: .github/workflows/splitTestsByTime.sh tmp/junit-xml-reports-downloaded ${{env.total-runners}} ${{ matrix.runner_index }} > testList.txt
|
|
|
|
- name: Upload Timing
|
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
|
|
|
if: matrix.runner_index == 0
|
|
|
|
with:
|
|
|
|
name: acceptance-tests-timing
|
|
|
|
path: 'tmp/timing.tsv'
|
|
|
|
- name: Upload Lists
|
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
|
|
|
if: matrix.runner_index == 0
|
|
|
|
with:
|
|
|
|
name: acceptance-tests-lists
|
|
|
|
path: 'tmp/*.list'
|
|
|
|
- name: format gradle args
|
|
|
|
# insert --tests option between each.
|
|
|
|
run: cat testList.txt | sed -e 's/^\| / --tests /g' | tee gradleArgs.txt
|
|
|
|
- name: run acceptance tests
|
|
|
|
run: ./gradlew acceptanceTestNotPrivacy `cat gradleArgs.txt` -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
|
|
|
|
- name: cleanup tempfiles
|
|
|
|
run: rm testList.txt gradleArgs.txt
|
|
|
|
- name: Upload Acceptance Test Results
|
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
|
|
|
with:
|
|
|
|
name: acceptance-node-${{matrix.runner_index}}-test-results
|
|
|
|
path: 'acceptance-tests/tests/build/test-results/**/TEST-*.xml'
|
|
|
|
accepttests-passed:
|
|
|
|
name: "accepttests-passed"
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: [ acceptanceTestEthereum ]
|
|
|
|
permissions:
|
|
|
|
checks: write
|
|
|
|
statuses: write
|
|
|
|
if: always()
|
|
|
|
steps:
|
|
|
|
# Fail if any `needs` job was not a success.
|
|
|
|
# Along with `if: always()`, this allows this job to act as a single required status check for the entire workflow.
|
|
|
|
- name: Fail on workflow error
|
|
|
|
run: exit 1
|
|
|
|
if: >-
|
|
|
|
${{
|
|
|
|
contains(needs.*.result, 'failure')
|
|
|
|
|| contains(needs.*.result, 'cancelled')
|
|
|
|
|| contains(needs.*.result, 'skipped')
|
|
|
|
}}
|