From 934e43558bd4f6ed546e076d27990b5d032426f5 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Tue, 12 Mar 2024 18:24:22 -0400 Subject: [PATCH] Gha updates (#6705) * make artifacts more snapshot friendly * break out new workflows for snapshots, and a develop releease * removes checking for approval, runs on pr update * adds concurrency so updated refs cancel prior runs if still running * explicitly disable caching on gradle setup tasks --------- Signed-off-by: Justin Florentine --- .github/workflows/acceptance-tests.yml | 47 ++------- .github/workflows/artifacts.yml | 46 ++++++--- .github/workflows/codeql.yml | 16 ++- .github/workflows/develop.yml | 64 ++++++++++++ .github/workflows/docker.yml | 7 ++ .github/workflows/integration-tests.yml | 52 ++-------- .github/workflows/nightly.yml | 125 ------------------------ .github/workflows/pre-review.yml | 20 +++- .github/workflows/reference-tests.yml | 57 ++--------- .github/workflows/release.yml | 3 +- .github/workflows/sonarcloud.yml | 2 + 11 files changed, 154 insertions(+), 285 deletions(-) create mode 100644 .github/workflows/develop.yml delete mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 39af80ba6e6..bd89270942e 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -5,58 +5,22 @@ on: branches: - main - release-* - pull_request_review: - types: [submitted] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" total-runners: 16 jobs: - shouldRun: - name: checks to ensure we should run - # necessary because there is no single PR approved event, need to check all comments/approvals/denials - runs-on: ubuntu-22.04 - outputs: - shouldRun: ${{steps.shouldRun.outputs.result}} - steps: - - name: required check - id: shouldRun - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - env: - # fun fact, this changes based on incoming event, it will be different when we run this on pushes to main - RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - with: - script: | - const { RELEVANT_SHA } = process.env; - const { data: { statuses } } = await github.rest.repos.getCombinedStatusForRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: RELEVANT_SHA, - }); - const acceptanceTested = statuses && statuses.filter(({ context }) => context === 'accepttests-passed'); - const alreadyRun = acceptanceTested && acceptanceTested.find(({ state }) => state === 'success') > 0; - const { data: reviews } = await github.rest.pulls.listReviews({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - }); - const approvingReviews = reviews && reviews.filter(review => review.state === 'APPROVED'); - const shouldRun = !alreadyRun && github.actor != 'dependabot[bot]' && (approvingReviews.length > 0); - - console.log("tests should be run = %j", shouldRun); - console.log("alreadyRun = %j", alreadyRun); - console.log("approvingReviews = %j", approvingReviews.length); - - return shouldRun; acceptanceTestEthereum: runs-on: ubuntu-22.04 name: "Acceptance Runner" - needs: shouldRun permissions: statuses: write checks: write - if: ${{ needs.shouldRun.outputs.shouldRun == 'true'}} strategy: fail-fast: true matrix: @@ -81,6 +45,8 @@ jobs: if_no_artifact_found: true - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: Split tests id: split-tests uses: r7kamura/split-tests-by-timings@9322bd292d9423e2bc5a65bec548901801341e3f @@ -111,6 +77,7 @@ jobs: report_paths: 'acceptance-tests/tests/build/test-results/**/TEST-*.xml' annotate_only: true accepttests-passed: + name: "accepttests-passed" runs-on: ubuntu-22.04 needs: [ acceptanceTestEthereum ] permissions: diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 6923a43a94e..6a737252bcc 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -1,11 +1,12 @@ -name: artifacts +name: release artifacts on: - workflow_dispatch: release: types: - prereleased +env: + GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.caching=true" jobs: artifacts: @@ -22,9 +23,11 @@ jobs: java-version: '17' - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - - name: assemble distributions + with: + cache-disabled: true + - name: assemble release run: - ./gradlew -Prelease.releaseVersion=${{github.ref_name}} -Pversion=${{github.ref_name}} assemble -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + ./gradlew -Prelease.releaseVersion=${{github.ref_name}} -Pversion=${{github.ref_name}} assemble - name: hashes id: hashes run: | @@ -43,16 +46,6 @@ jobs: path: 'build/distributions/besu*.zip' name: besu-${{ github.ref_name }}.zip compression-level: 0 - - name: Upload Release assets - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 - with: - append_body: true - files: | - build/distributions/besu*.tar.gz - build/distributions/besu*.zip - body: | - ${{steps.hashes.outputs.tarSha}} - ${{steps.hashes.outputs.zipSha}} testWindows: runs-on: windows-2022 needs: artifacts @@ -67,13 +60,34 @@ jobs: - name: Download zip uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe with: - name: besu-${{ github.ref_name }}.zip + pattern: besu-*.zip + merge-multiple: true - name: test Besu run: | + dir unzip besu-*.zip -d besu-tmp cd besu-tmp mv besu-* ../besu cd .. besu\bin\besu.bat --help besu\bin\besu.bat --version - + publish: + runs-on: ubuntu-22.04 + needs: testWindows + steps: + - name: Download archives + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe + with: + pattern: besu-* + merge-multiple: true + path: 'build/distributions' + - name: Upload Release assets + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + with: + append_body: true + files: | + build/distributions/besu*.tar.gz + build/distributions/besu*.zip + body: | + ${{steps.hashes.outputs.tarSha}} + ${{steps.hashes.outputs.zipSha}} \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f0340e168c7..0a50ec57c2d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,15 +13,11 @@ name: "CodeQL" on: workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - paths-ignore: - - '**/*.json' - - '**/*.md' - - '**/*.properties' - - '**/*.txt' + schedule: + # * is a special character in YAML so you have to quote this string + # expression evaluates to midnight every night + - cron: '0 0 * * *' + jobs: analyze: name: Analyze @@ -50,6 +46,8 @@ jobs: - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: compileJava noscan run: | JAVA_OPTS="-Xmx2048M" ./gradlew --no-scan compileJava diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 00000000000..fbafc9e4f23 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,64 @@ + +name: develop pre-release + +on: + push: + branches: + - main +env: + GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.caching=true" + +jobs: + artifacts: + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up JDK 17 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + distribution: 'temurin' + java-version: '17' + - name: setup gradle + uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true + - name: assemble release + run: + ./gradlew assemble + - name: upload tarball + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + with: + path: 'build/distributions/besu*.tar.gz' + name: besu-develop.tar.gz + compression-level: 0 + - name: hashes + id: hashes + run: | + cd build/distributions + echo "zipSha=$(shasum -a 256 besu*.zip)" >> $GITHUB_OUTPUT + echo "tarSha=$(shasum -a 256 besu*.tar.gz)" >> $GITHUB_OUTPUT + - name: upload zipfile + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + with: + path: 'build/distributions/besu*.zip' + name: besu-develop.zip + compression-level: 0 + - name: Upload Release assets + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + with: + prerelease: true + name: develop + tag_name: develop + fail_on_unmatched_files: true + append_body: false + files: | + build/distributions/besu*.tar.gz + build/distributions/besu*.zip + body: | + This is an automated, bleeding edge build from the tip of ${{ github.ref_name }}. No promises. YOLO. + + ${{steps.hashes.outputs.tarSha}} + ${{steps.hashes.outputs.zipSha}} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8889b0dc7ad..3155667b9e6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,6 +19,8 @@ jobs: java-version: 17 - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: hadoLint_openj9-jdk_17 run: docker run --rm -i hadolint/hadolint < docker/openj9-jdk-17/Dockerfile - name: hadoLint_openjdk_17 @@ -66,6 +68,8 @@ jobs: java-version: 17 - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: install goss run: | mkdir -p docker/reports @@ -81,6 +85,7 @@ jobs: env: architecture: ${{ steps.prep.outputs.ARCH }} with: + cache-disabled: true arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pversion=${{github.ref_name}} -Prelease.releaseVersion=${{ github.ref_name }} - name: publish env: @@ -102,6 +107,8 @@ jobs: java-version: 17 - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: login to ${{ env.registry }} uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d with: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 80a2eca1e27..944422cbdf8 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,54 +5,18 @@ on: branches: - main - release-* - pull_request_review: - types: - - submitted + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: - GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" + GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.caching=true" jobs: - shouldRun: - name: checks to ensure we should run - runs-on: ubuntu-22.04 - outputs: - shouldRun: ${{steps.shouldRun.outputs.result}} - steps: - - name: required check - id: shouldRun - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - env: - # fun fact, this changes based on incoming event, it will be different when we run this on pushes to main - RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - with: - script: | - const { RELEVANT_SHA } = process.env; - const { data: { statuses } } = await github.rest.repos.getCombinedStatusForRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: RELEVANT_SHA, - }); - - const intTested = statuses && statuses.filter(({ context }) => context === 'integration-tests'); - const alreadyRun = intTested && intTested.find(({ state }) => state === 'success') > 0; - const { data: reviews } = await github.rest.pulls.listReviews({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - }); - const approvingReviews = reviews && reviews.filter(review => review.state === 'APPROVED'); - const shouldRun = !alreadyRun && github.actor != 'dependabot[bot]' && (approvingReviews.length > 0); - - console.log("tests should be run = %j", shouldRun); - console.log("alreadyRun = %j", alreadyRun); - console.log("approvingReviews = %j", approvingReviews.length); - - return shouldRun; integration-tests: + name: "integration-passed" runs-on: ubuntu-22.04 - needs: shouldRun - if: ${{ needs.shouldRun.outputs.shouldRun == 'true' }} permissions: statuses: write checks: write @@ -68,8 +32,10 @@ jobs: java-version: 17 - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: run integration tests - run: ./gradlew integrationTest compileJmh -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + run: ./gradlew integrationTest compileJmh - name: Publish Test Report uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 if: (success() || failure()) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 3defa71ab5a..00000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: nightly - -on: - workflow_dispatch: - schedule: - # * is a special character in YAML so you have to quote this string - # expression evaluates to midnight every night - - cron: '0 0 * * *' - -env: - nightly-tag: develop - registry: docker.io - -jobs: - hadolint: - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up Java - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 - with: - distribution: temurin - java-version: 17 - - name: setup gradle - uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - - name: hadoLint_openj9-jdk_17 - run: docker run --rm -i hadolint/hadolint < docker/openj9-jdk-17/Dockerfile - - name: hadoLint_openjdk_17 - run: docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile - - name: hadoLint_openjdk_17_debug - run: docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile - - name: hadoLint_openjdk_latest - run: docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile - - name: hadoLint_graalvm - run: docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile - buildDocker: - needs: hadolint - permissions: - contents: read - packages: write - strategy: - fail-fast: false - matrix: - platform: - - ubuntu-22.04 - - [self-hosted, ARM64] - runs-on: ${{ matrix.platform }} - steps: - - name: Prepare - id: prep - run: | - platform=${{ matrix.platform }} - if [ "$platform" = 'ubuntu-22.04' ]; then - echo "PLATFORM_PAIR=linux-amd64" >> $GITHUB_OUTPUT - echo "ARCH=amd64" >> $GITHUB_OUTPUT - else - echo "PLATFORM_PAIR=linux-arm64" >> $GITHUB_OUTPUT - echo "ARCH=arm64" >> $GITHUB_OUTPUT - fi - - name: Checkout Repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: short sha - id: shortSha - run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Set up Java - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 - with: - distribution: temurin - java-version: 17 - - name: login to ${{ env.registry }} - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ${{ env.registry }} - username: ${{ secrets.DOCKER_USER_RW }} - password: ${{ secrets.DOCKER_PASSWORD_RW }} - - name: build image - uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - with: - arguments: distDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Pbranch=main - - name: install goss - run: | - mkdir -p docker/reports - curl -L https://github.com/aelsabbahy/goss/releases/download/v0.4.4/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} -o ./docker/tests/goss-${{ steps.prep.outputs.PLATFORM_PAIR }} - - name: test docker - uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - env: - architecture: ${{ steps.prep.outputs.ARCH }} - with: - arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Pbranch=main - - name: login to $ {{ env.registry }} - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ${{ env.registry }} - username: ${{ secrets.DOCKER_USER_RW }} - password: ${{ secrets.DOCKER_PASSWORD_RW }} - - name: publish - env: - architecture: ${{ steps.prep.outputs.ARCH }} - run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pbranch=main - multiArch: - permissions: - contents: read - packages: write - needs: buildDocker - runs-on: ubuntu-22.04 - steps: - - name: Checkout Repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up Java - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 - with: - distribution: temurin - java-version: 17 - - name: setup gradle - uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - - name: Login to ${{ env.registry }} - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ${{ env.registry }} - username: ${{ secrets.DOCKER_USER_RW }} - password: ${{ secrets.DOCKER_PASSWORD_RW }} - - name: multi-arch docker - run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }} -Pbranch=main - diff --git a/.github/workflows/pre-review.yml b/.github/workflows/pre-review.yml index 0d3a3e6c900..b3adc7c42cd 100644 --- a/.github/workflows/pre-review.yml +++ b/.github/workflows/pre-review.yml @@ -6,6 +6,13 @@ on: - main - release-* +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true" + jobs: repolint: name: "Repository Linting" @@ -41,8 +48,10 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: run spotless - run: ./gradlew spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + run: ./gradlew spotlessCheck compile: runs-on: ubuntu-22.04 timeout-minutes: 30 @@ -59,8 +68,10 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: Gradle Compile - run: ./gradlew build -x test -x spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + run: ./gradlew build -x test -x spotlessCheck unitTests: env: GRADLEW_UNIT_TEST_ARGS: ${{matrix.gradle_args}} @@ -92,9 +103,11 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: run unit tests id: unitTest - run: ./gradlew $GRADLEW_UNIT_TEST_ARGS -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + run: ./gradlew $GRADLEW_UNIT_TEST_ARGS - name: Publish Test Report uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 if: success() || failure() # always run even if the build step fails @@ -102,6 +115,7 @@ jobs: report_paths: '**/test-results/**/TEST-*.xml' annotate_only: true unittests-passed: + name: "unittests-passed" runs-on: ubuntu-22.04 needs: [unitTests] permissions: diff --git a/.github/workflows/reference-tests.yml b/.github/workflows/reference-tests.yml index ccb03632db3..f9dd87c4589 100644 --- a/.github/workflows/reference-tests.yml +++ b/.github/workflows/reference-tests.yml @@ -5,63 +5,22 @@ on: branches: - main - release-* - pull_request_review: - types: [ submitted ] env: - GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" + GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.caching=true" total-runners: 10 -jobs: - shouldRun: - name: checks to ensure we should run - # necessary because there is no single PR approved event, need to check all comments/approvals/denials - # might also be a job running, and additional approvals - runs-on: ubuntu-22.04 - outputs: - shouldRun: ${{steps.shouldRun.outputs.result}} - steps: - - name: required check - id: shouldRun - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - env: - # fun fact, this changes based on incoming event, it will be different when we run this on pushes to main - RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - with: - script: | - const { RELEVANT_SHA } = process.env; - const { data: { statuses } } = await github.rest.repos.getCombinedStatusForRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: RELEVANT_SHA, - }); - - - const refTested = statuses && statuses.filter(({ context }) => context === 'reftests-passed'); - const alreadyRun = refTested && refTested.find(({ state }) => state === 'success') > 0; - const { data: reviews } = await github.rest.pulls.listReviews({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - }); - const approvingReviews = reviews && reviews.filter(review => review.state === 'APPROVED'); - const shouldRun = !alreadyRun && github.actor != 'dependabot[bot]' && (approvingReviews.length > 0); - - console.log("tests should be run = %j", shouldRun); - console.log("alreadyRun = %j", alreadyRun); - console.log("approvingReviews = %j", approvingReviews.length); - - return shouldRun; +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: referenceTestEthereum: runs-on: ubuntu-22.04 permissions: statuses: write checks: write packages: read - needs: - - shouldRun - if: ${{ needs.shouldRun.outputs.shouldRun == 'true' }} strategy: fail-fast: true matrix: @@ -79,7 +38,8 @@ jobs: java-version: 17 - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 - #shame the test generation isn't less redundant, we used to do this in a dependent job, but artifact downloading broke + with: + cache-disabled: true - name: execute generate reference tests run: ./gradlew ethereum:referencetests:blockchainReferenceTests ethereum:referencetests:generalstateReferenceTests ethereum:referencetests:generalstateRegressionReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true - name: list test files generated @@ -95,7 +55,7 @@ jobs: - name: refTestArgs.txt run: cat refTestArgs.txt - name: run reference tests - run: ./gradlew ethereum:referenceTests:referenceTests `cat refTestArgs.txt` -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + run: ./gradlew ethereum:referenceTests:referenceTests `cat refTestArgs.txt` - name: Upload Test Report uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 if: always() # always run even if the previous step fails @@ -109,6 +69,7 @@ jobs: report_paths: '**/build/test-results/referenceTests/TEST-*.xml' annotate_only: true reftests-passed: + name: "reftests-passed" runs-on: ubuntu-22.04 needs: [ referenceTestEthereum ] permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ceb8ba602cb..3ae4a0ddf8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,5 @@ name: release besu on: - workflow_dispatch: release: types: [released] env: @@ -23,6 +22,8 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD_RW }} - name: Setup Gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: Docker upload run: ./gradlew "-Prelease.releaseVersion=${{ github.ref_name }}" "-PdockerOrgName=${{ env.registry }}/${{ secrets.DOCKER_ORG }}" dockerUploadRelease - name: Docker manifest diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 7891a6819db..3ef37c1dafa 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -30,6 +30,8 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: setup gradle uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1 + with: + cache-disabled: true - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any