diff --git a/.circleci/config.yml b/.circleci/config.yml index bff2f447944..e69de29bb2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,505 +0,0 @@ ---- -version: 2.1 -orbs: - win: circleci/windows@5.0 - -executors: - besu_executor_med: # 2cpu, 4G ram - docker: - - image: cimg/openjdk:17.0 - resource_class: medium - working_directory: ~/project - environment: - architecture: "amd64" - GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 - - besu_arm64_executor_med: # 2cpu, 8G ram - machine: #https://circleci.com/developer/machine/image/ubuntu-2204 - image: ubuntu-2204:2022.10.2 - resource_class: arm.medium - working_directory: ~/project - environment: - architecture: "arm64" - GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 - - besu_executor_xl: # 8cpu, 16G ram - docker: - - image: cimg/openjdk:17.0 - resource_class: xlarge - working_directory: ~/project - environment: - GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4 - - xl_machine_executor: - machine: #https://circleci.com/developer/machine/image/ubuntu-2204 - image: ubuntu-2204:2022.10.2 - resource_class: xlarge - - trivy_executor: - docker: - - image: docker:stable-git - resource_class: small - working_directory: ~/project - -commands: - prepare: - description: "Prepare" - steps: - - checkout - - run: - name: Install Packages - LibSodium, nssdb - command: | - sudo apt-get update - sudo apt-get install -y libsodium23 libsodium-dev libjemalloc-dev apt-transport-https haveged libnss3-tools - sudo service haveged restart - java --version - - restore_gradle_cache - restore_gradle_cache: - description: "Restore Gradle cache" - steps: - - restore_cache: - name: Restore cached gradle dependencies - keys: - - deps-{{ checksum "gradle/versions.gradle" }}-{{ .Branch }}-{{ .Revision }} - - deps-{{ checksum "gradle/versions.gradle" }} - - deps- - - capture_test_results: - description: "Capture test results" - steps: - - run: - name: Jacoco - command: | - ./gradlew --no-daemon jacocoTestReport - - run: - name: Gather test results - when: always - command: | - FILES=`find . -name test-results` - for FILE in $FILES - do - MODULE=`echo "$FILE" | sed -e 's@./\(.*\)/build/test-results@\1@'` - TARGET="build/test-results/$MODULE" - mkdir -p "$TARGET" - cp -rf ${FILE}/*/* "$TARGET" - done - - store_test_results: - path: build/test-results - - store_artifacts: - path: besu/build/reports/jacoco - - capture_test_logs: - description: "Capture test logs" - steps: - - store_artifacts: - path: acceptance-tests/tests/build/acceptanceTestLogs - destination: acceptance-tests-logs - - store_artifacts: - path: acceptance-tests/tests/build/jvmErrorLogs - -jobs: - assemble: - executor: besu_executor_xl - steps: - - prepare - - run: - name: Assemble - command: | - ./gradlew --no-daemon clean compileJava compileTestJava assemble - - save_cache: - name: Caching gradle dependencies - key: deps-{{ checksum "gradle/versions.gradle" }}-{{ .Branch }}-{{ .Revision }} - paths: - - .gradle - - ~/.gradle - - persist_to_workspace: - root: ~/project - paths: - - ./ - - store_artifacts: - name: Distribution artifacts - path: build/distributions - destination: distributions - when: always - - testWindows: - executor: win/default - steps: - - attach_workspace: - at: ~/project - - run: - name: Unzip Windows build - no_output_timeout: 20m - command: | - cd build/distributions - unzip besu-*.zip -d besu-tmp - cd besu-tmp - mv besu-* ../besu - - run: - name: Test Besu Windows executable - no_output_timeout: 10m - command: | - build\distributions\besu\bin\besu.bat --help - build\distributions\besu\bin\besu.bat --version - - dockerScan: - executor: trivy_executor - steps: - - checkout - - restore_gradle_cache - - setup_remote_docker: - docker_layer_caching: true - - run: - name: Install trivy - command: | - apk add --update-cache --upgrade curl bash - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin - - run: - name: Scan with trivy - shell: /bin/sh - command: | - for FILE in $(ls docker) - do - if [[ $FILE == "test.sh" || $FILE == "tests" ]]; then - continue - fi - docker pull -q "hyperledger/besu:develop-$FILE" - trivy -q image --exit-code 1 --no-progress --severity HIGH,CRITICAL "hyperledger/besu:develop-$FILE" - done - - unitTests: - executor: besu_executor_xl - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: Build - no_output_timeout: 20m - command: | - ./gradlew --no-daemon build - - capture_test_results - - integrationTests: - executor: xl_machine_executor # needs the machine executor since privacy test uses container tests (docker) - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: IntegrationTests - command: | - ./gradlew --no-daemon integrationTest - - run: - name: CompileJmh - command: | - ./gradlew --no-daemon compileJmh - - capture_test_results - - referenceTests: - executor: besu_executor_xl - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: ReferenceTests - no_output_timeout: 30m - command: | - git submodule update --init --recursive - ./gradlew --no-daemon referenceTest - - capture_test_results - - acceptanceTests: - parallelism: 2 - executor: xl_machine_executor # needs the machine executor since privacy test uses container tests (docker) - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: AcceptanceTests (Mainnet) - no_output_timeout: 20m - command: | - CLASSNAMES=$(circleci tests glob "acceptance-tests/tests/src/test/java/**/*.java" \ - | sed 's@.*/src/test/java/@@' \ - | sed 's@/@.@g' \ - | sed 's/.\{5\}$//' \ - | circleci tests split --split-by=timings --timings-type=classname) - # Format the arguments to "./gradlew test" - GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}') - ./gradlew --no-daemon acceptanceTestMainnet $GRADLE_ARGS - - capture_test_results - - capture_test_logs - - acceptanceTestsCliqueBft: - executor: besu_executor_xl - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: AcceptanceTests (Non-Mainnet) - no_output_timeout: 20m - command: | - ./gradlew --no-daemon acceptanceTestCliqueBft - - capture_test_results - - capture_test_logs - - acceptanceTestsPrivacy: - parallelism: 4 - executor: xl_machine_executor # needs the machine executor since it uses container tests (docker) - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: AcceptanceTests (Non-Mainnet) - no_output_timeout: 20m - command: | - CLASSNAMES=$(circleci tests glob "acceptance-tests/tests/src/test/java/**/*.java" \ - | sed 's@.*/src/test/java/@@' \ - | sed 's@/@.@g' \ - | sed 's/.\{5\}$//' \ - | circleci tests split --split-by=timings --timings-type=classname) - # Format the arguments to "./gradlew test" - GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}') - ./gradlew --no-daemon acceptanceTestPrivacy $GRADLE_ARGS - - capture_test_results - - capture_test_logs - - acceptanceTestsPermissioning: - executor: besu_executor_xl - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: AcceptanceTests (Non-Mainnet) - no_output_timeout: 20m - command: | - ./gradlew --no-daemon acceptanceTestPermissioning - - capture_test_results - - capture_test_logs - - buildDocker: - executor: besu_executor_med - steps: - - prepare - - attach_workspace: - at: ~/project - - setup_remote_docker - - run: - name: hadoLint_openjdk_17 - command: | - docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile - - run: - name: hadoLint_openjdk_17_debug - command: | - docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile - - run: - name: hadoLint_openjdk_latest - command: | - docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile - - run: - name: hadoLint_graalvm - command: | - docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile - - run: - name: build image - command: | - ./gradlew --no-daemon distDocker - - run: - name: test image - command: | - mkdir -p docker/reports - curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-amd64 -o ./docker/tests/goss-linux-amd64 - ./gradlew --no-daemon testDocker - - buildArm64Docker: - executor: besu_arm64_executor_med - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: hadoLint_openjdk_17 - command: | - docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile - - run: - name: hadoLint_openjdk_latest - command: | - docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile - - run: - name: hadoLint_graalvm - command: | - docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile - - run: - name: Java_17 - command: | - sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless - sudo update-java-alternatives -a - - run: - name: build image - command: | - ./gradlew --no-daemon distDocker - - run: - name: test image - command: | - mkdir -p docker/reports - curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-arm -o ./docker/tests/goss-linux-arm64 - ./gradlew --no-daemon testDocker - - publish: - executor: besu_executor_med - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: Publish - command: | - ./gradlew --no-daemon artifactoryPublish - - publishDocker: - executor: besu_executor_med - steps: - - prepare - - attach_workspace: - at: ~/project - - setup_remote_docker - - run: - name: Publish Docker - command: | - docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}" - ./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" dockerUpload - - publishArm64Docker: - executor: besu_arm64_executor_med - steps: - - prepare - - attach_workspace: - at: ~/project - - run: - name: Java_17 - command: | - sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless - sudo update-java-alternatives -a - - run: - name: Publish Docker - command: | - docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}" - ./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" dockerUpload - manifestDocker: - executor: besu_executor_med - steps: - - prepare - - setup_remote_docker - - run: - name: Create and publish docker manifest - command: | - docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}" - ./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" --parallel manifestDocker - -workflows: - version: 2 - default: - jobs: - - assemble - - unitTests: - requires: - - assemble - - testWindows: - requires: - - assemble - - referenceTests: - requires: - - assemble - - integrationTests: - requires: - - assemble - - acceptanceTests: - requires: - - assemble - - acceptanceTestsCliqueBft: - requires: - - assemble - - acceptanceTests - - acceptanceTestsPermissioning: - requires: - - assemble - - acceptanceTestsCliqueBft - - buildDocker: - requires: - - assemble - - buildArm64Docker: - requires: - - assemble - - publish: - filters: - branches: - only: - - main - - /^release-.*/ - requires: - - assemble - - integrationTests - - unitTests - - acceptanceTests - - referenceTests - - buildDocker - - publishDocker: - filters: - branches: - only: - - main - - /^release-.*/ - requires: - - assemble - - integrationTests - - unitTests - - acceptanceTests - - referenceTests - - buildDocker - context: - - besu-dockerhub-rw - - publishArm64Docker: - filters: - branches: - only: - - main - - /^release-.*/ - requires: - - integrationTests - - unitTests - - acceptanceTests - - referenceTests - - buildArm64Docker - context: - - besu-dockerhub-rw - - manifestDocker: - filters: - branches: - only: - - main - - /^release-.*/ - requires: - - publishDocker - - publishArm64Docker - context: - - besu-dockerhub-rw - - nightly: - triggers: - - schedule: - cron: "0 19 * * *" - filters: - branches: - only: - - main - jobs: - - assemble - - dockerScan - - acceptanceTestsPrivacy: - requires: - - assemble diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index ccf371fb808..f40f3c71318 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -1,6 +1,7 @@ name: acceptance-tests on: - workflow_call: + pull_request_review: + types: [ submitted ] env: @@ -9,7 +10,8 @@ env: jobs: runner-indexes: - runs-on: ubuntu-22.04 + runs-on: + group: "Besu Large Runners" name: Generate runner indexes outputs: json: ${{ steps.generate-index-list.outputs.json }} @@ -21,23 +23,17 @@ jobs: INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) echo "::set-output name=json::${INDEX_JSON}" acceptanceTestEthereum: - runs-on: [ self-hosted, X64, Linux ] + runs-on: + group: "Besu Large Runners" name: "Acceptance Runner #${{ matrix.runner-index }}: Run acceptance tests in parallel" needs: - runner-indexes - if: ${{ github.actor != 'dependabot[bot]' }} + if: ${{ github.actor != 'dependabot[bot]'}} strategy: fail-fast: false matrix: runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} steps: - - name: export runner UID - run: echo "runner_uid=$UID" >> $GITHUB_ENV - - name: install native packages - run: | - sudo apt-get update - sudo apt-get install -y libsodium23 libsodium-dev libjemalloc-dev apt-transport-https haveged libnss3-tools - sudo service haveged restart - name: Checkout Repo uses: actions/checkout@v3 - name: Set up Java @@ -46,11 +42,12 @@ jobs: distribution: adopt java-version: 17 cache: gradle - - name: Restore classes - uses: actions/cache@v3 + - name: Compile + uses: gradle/gradle-build-action@v2 with: - path: "**/*.class" - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + gradle-home-cache-cleanup: true + cache-read-only: false + arguments: compileJava compileTestJava -Dorg.gradle.parallel=true - name: Split tests id: split-tests uses: chaosaffe/split-tests@v1-alpha.1 @@ -71,21 +68,8 @@ jobs: run: ./gradlew acceptanceTest --tests `cat gradleArgs.txt` - name: cleanup tempfiles run: rm testList.txt gradleArgs.txt - - name: Correct Ownership in GITHUB_WORKSPACE directory - uses: peter-murray/reset-workspace-ownership-action@v1 - with: - user_id: ${{ env.runner_uid }} - - name: Upload Test Report - uses: actions/upload-artifact@v3 - if: always() # always run even if the previous step fails - with: - name: junit-acceptance-${{ matrix.runner-index }}-test-results - path: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml' - retention-days: 1 - - name: Acceptance Test Report html - uses: actions/upload-artifact@v3 - if: always() # always run even if the previous step fails + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # always run even if the build step fails with: - name: html-acceptance-${{ matrix.runner-index }}-test-results - path: 'acceptance-tests/tests/build/reports/tests/acceptanceTest/**' - retention-days: 1 + report_paths: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml' diff --git a/.github/workflows/callee.yml b/.github/workflows/callee.yml new file mode 100644 index 00000000000..1b7a6cc3ace --- /dev/null +++ b/.github/workflows/callee.yml @@ -0,0 +1,13 @@ +name: callee + +on: + workflow_run: + workflows: [ "caller" ] + types: [ "requested" ] + workflow_dispatch: + +jobs: + echo: + runs-on: ubuntu-22.04 + steps: + - run: echo called diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml new file mode 100644 index 00000000000..7955282a23e --- /dev/null +++ b/.github/workflows/caller.yml @@ -0,0 +1,9 @@ +name: caller + +on: pull_request + +jobs: + echo: + runs-on: ubuntu-22.04 + steps: + - run: echo calling diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e69de29bb2d..bed65b5e2ce 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -0,0 +1,37 @@ +name: "checks" + +on: + pull_request: + +jobs: + lint: + name: "Repository Linting" + runs-on: ubuntu-22.04 + container: ghcr.io/todogroup/repolinter:v0.11.2 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Lint Repo + run: bundle exec /app/bin/repolinter.js --rulesetUrl https://raw.githubusercontent.com/hyperledger-labs/hyperledger-community-management-tools/main/repo_structure/repolint.json --format markdown + gradle-wrapper: + name: "Gradle Wrapper Validation" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v1.1.0 + spotless: + runs-on: ubuntu-22.04 + if: ${{ github.actor != 'dependabot[bot]' }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: 17 + - name: spotless + uses: gradle/gradle-build-action@v2.10.0 + with: + arguments: build spotlessCheck -Dorg.gradle.parallel=true + cache: gradle diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index a53212cdd34..d5544ba6b3e 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,18 +1,19 @@ name: compile on: - push: - branches: [ main ] - pull_request: + workflow_run: + workflows: + - checks + types: + - completed env: GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" - total-runners: 6 jobs: compile: runs-on: ubuntu-22.04 timeout-minutes: 30 - if: ${{ github.actor != 'dependabot[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -25,39 +26,4 @@ jobs: - name: Compile uses: gradle/gradle-build-action@v2 with: - gradle-home-cache-cleanup: true - cache-read-only: false - arguments: compileJava compileTestJava -Dorg.gradle.parallel=true - compileJmh: - runs-on: ubuntu-22.04 - needs: compile - timeout-minutes: 30 - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Set up Java - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 17 - cache: gradle - - name: compileJmh - uses: gradle/gradle-build-action@v2 - with: - arguments: compileJmh - - javadoc_17: - runs-on: ubuntu-22.04 - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Set up Java 17 - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 17 - cache: gradle - - name: javadoc (JDK 17) - run: ./gradlew --no-daemon javadoc + arguments: build -x test -x spotlessCheck -Dorg.gradle.parallel=true diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 0007837da19..bcad0841949 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -1,15 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 -name: "Validate Gradle Wrapper" +name: gradle-wrapper-validation on: - push: - branches: [ main ] - pull_request: - workflow_dispatch: + workflow_call: + jobs: validation: name: "Gradle Wrapper Validation" - runs-on: [besu-research-ubuntu-8] + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml index 991af8952da..b6307d97cee 100644 --- a/.github/workflows/javadoc.yml +++ b/.github/workflows/javadoc.yml @@ -1,10 +1,6 @@ name: javadoc on: - workflow_dispatch: - workflow_run: - workflows: [compile] - types: - - completed + workflow_call: env: GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" @@ -23,9 +19,5 @@ jobs: distribution: adopt java-version: 17 cache: gradle - - name: Restore classes - uses: actions/download-artifact@v3 - with: - name: classes - name: javadoc (JDK 17) run: ./gradlew --no-daemon javadoc diff --git a/.github/workflows/parallel-unit-tests.yml b/.github/workflows/parallel-unit-tests.yml new file mode 100644 index 00000000000..33bd2710ef3 --- /dev/null +++ b/.github/workflows/parallel-unit-tests.yml @@ -0,0 +1,48 @@ +name: parallel-unit-tests +on: + workflow_call: + +env: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + total-runners: 4 +jobs: + junit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + runner_index: + - 0 + - 1 + - 2 + - 3 + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Split tests + id: split-tests + uses: chaosaffe/split-tests@v1-alpha.1 + with: + glob: '**/src/test/java/**/*.java' + split-total: ${{ env.total-runners }} + split-index: ${{ matrix.runner_index }} + line-count: true + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: 17 + cache: gradle + - name: write out test list + run: echo "${{ steps.split-tests.outputs.test-suite }}" >> testList.txt + - name: debug testfile paths + run: cat testList.txt + - name: format gradle args + # regex means: truncate file paths to align with package name, replacing with tests switch, then drop file extension, + # then swap path delimiter with package delimiter + run: cat testList.txt | sed -e 's/[^ ]*src\/test\/java\//--tests\ /g' -e 's/\.java//g' -e 's/\//\./g' >> gradleArgs.txt + - name: debug test class list + run: cat gradleArgs.txt + - name: run unit tests + run: ./gradlew test `cat gradleArgs.txt` + diff --git a/.github/workflows/reference-tests.yml b/.github/workflows/reference-tests.yml index 5a55f6aefe9..3d5149c0bbc 100644 --- a/.github/workflows/reference-tests.yml +++ b/.github/workflows/reference-tests.yml @@ -9,7 +9,7 @@ env: jobs: runner-indexes: - runs-on: ubuntu-22.04 + runs-on: besu-research-ubuntu-8 name: Generate runner indexes outputs: json: ${{ steps.generate-index-list.outputs.json }} @@ -21,7 +21,7 @@ jobs: INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) echo "::set-output name=json::${INDEX_JSON}" prepareReferenceTestEthereum: - runs-on: [ self-hosted, Linux, X64 ] + runs-on: besu-research-ubuntu-8 timeout-minutes: 30 if: ${{ github.actor != 'dependabot[bot]' }} steps: @@ -57,7 +57,7 @@ jobs: path: "ethereum/referencetests/build/generated/sources/reference-test/**" key: ${{ runner.os }}-reftests-${{ github.sha }} referenceTestEthereum: - runs-on: [ self-hosted, X64, Linux ] + runs-on: besu-research-ubuntu-8 needs: - prepareReferenceTestEthereum - runner-indexes @@ -110,7 +110,7 @@ jobs: path: '**/build/test-results/referenceTests/TEST-*.xml' retention-days: 1 referenceTestQbft: - runs-on: [ self-hosted, Linux, X64 ] + runs-on: besu-research-ubuntu-8 timeout-minutes: 30 if: ${{ github.actor != 'dependabot[bot]' }} steps: diff --git a/.github/workflows/repolinter.yml b/.github/workflows/repolinter.yml index f7a8e820192..bfc97b11da6 100644 --- a/.github/workflows/repolinter.yml +++ b/.github/workflows/repolinter.yml @@ -1,21 +1,15 @@ # SPDX-License-Identifier: Apache-2.0 # Hyperledger Repolinter Action -name: Repolinter +name: repolinter on: - push: - branches: - - master - - main - pull_request: - branches: - - master - - main + workflow_call: + jobs: build: - runs-on: [besu-research-ubuntu-16] - container: ghcr.io/todogroup/repolinter:v0.10.1 + runs-on: ubuntu-22.04 + container: ghcr.io/todogroup/repolinter:v0.11.2 steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml index 83ad916112d..9849e271835 100644 --- a/.github/workflows/report.yml +++ b/.github/workflows/report.yml @@ -2,37 +2,21 @@ name: report on: workflow_call: - permissions: checks: write jobs: - runner-indexes: - runs-on: ubuntu-22.04 - name: Generate runner indexes - outputs: - json: ${{ steps.generate-index-list.outputs.json }} - steps: - - id: generate-index-list - run: | - MAX_INDEX=$((${{ env.total-runners }}-1)) - INDEX_LIST=$(seq 0 ${MAX_INDEX}) - INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) - echo "::set-output name=json::${INDEX_JSON}" unit-tests: runs-on: ubuntu-22.04 - strategy: - matrix: - runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} steps: - name: Download Test Report uses: dawidd6/action-download-artifact@v2 with: - name: junit-test-${{ matrix.runner-index }}-results + name: junit-test-results workflow: ${{ github.event.workflow.id }} run_id: ${{ github.event.workflow_run.id }} - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 with: commit: ${{github.event.workflow_run.head_sha}} report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index ab8fd3ec9fb..f1814fdccfa 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -1,8 +1,7 @@ -name: "Spotless Code Formatting" +name: spotless on: - push: - branches: [ main ] - pull_request: + workflow_call: + jobs: spotless: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000000..a65caaed36a --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,43 @@ +name: unit-tests +on: + workflow_run: + workflows: [ "compile" ] + types: [ "completed" ] + +env: + GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" + +jobs: + unitTests: + runs-on: besu-research-ubuntu-8 + if: ${{github.event.workflow_run.conclusion == 'success' }} + permissions: + checks: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: 17 + cache: gradle + - name: Build + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + cache-read-only: false + arguments: build -Dorg.gradle.parallel=true + - name: Upload Test Report + uses: actions/upload-artifact@v3 + if: always() # always run even if the previous step fails + with: + name: junit-xml-reports + path: '**/build/test-results/test/TEST-*.xml' + retention-days: 1 + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # always run even if the build step fails + with: + report_paths: '**/test-results/test/TEST-*.xml' + annotate_only: true