From b9a4474c6ae24d5a3d82975df3c7387c9e7ba2a8 Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Fri, 15 Mar 2024 19:13:59 -0700 Subject: [PATCH] publish snapshots with a backoff and retry to avoid spurious failures --- .github/actions/run-gradle/action.yml | 20 ++++++++++++++++++- .github/workflows/build.yml | 10 ++++++---- .github/workflows/codeql.yml | 2 +- .../dependency-submission-pr-submit.yml | 2 +- .github/workflows/dependency-submission.yml | 2 +- .github/workflows/examples.yml | 2 +- gradle/libs.versions.toml | 6 +++--- 7 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/actions/run-gradle/action.yml b/.github/actions/run-gradle/action.yml index 87000027d8..acfc0d2b92 100644 --- a/.github/actions/run-gradle/action.yml +++ b/.github/actions/run-gradle/action.yml @@ -18,6 +18,14 @@ inputs: token: required: false description: 'A Github PAT' + attempt-limit: + default: '1' + required: false + description: Number of attempts + attempt-delay: + default: '0' + required: false + description: A delay between attempts in seconds runs: using: composite steps: @@ -85,4 +93,14 @@ runs: JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }} ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' shell: bash - run: ./gradlew ${{ inputs.arguments }} + run: | + for ((i=1; i<=${{ inputs.attempt-limit }}; i++)); do + ./gradlew $(echo "${{ inputs.arguments }}" | tr -d '\n') && break + if [ $i -lt ${{ inputs.attempt-limit }} ]; then + echo "Attempt $i failed. Retrying in ${{ inputs.attempt-delay }} seconds..." + sleep ${{ inputs.attempt-delay }} + else + echo "All attempts failed." + exit 1 + fi + done diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3fdfa01f4..83e13d69f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: egress-policy: block allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }} - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Prepare GraalVM if: env.JAVA_VERSION == 'GraalVM' shell: bash @@ -174,7 +174,7 @@ jobs: egress-policy: block allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }} - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Run tests (${{ env.JAVA_VERSION }}) uses: ./.github/actions/run-gradle with: @@ -229,7 +229,7 @@ jobs: storage.googleapis.com:443 uploader.codecov.io:443 - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - name: Download Tests Results @@ -340,7 +340,7 @@ jobs: errorprone.info:443 lightbend.github.io:443 guava.dev:443 - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Publish Snapshot uses: ./.github/actions/run-gradle env: @@ -350,6 +350,8 @@ jobs: ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.OSSRH_GPG_SECRET_KEY_ID }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} with: + attempt-limit: 3 + attempt-delay: 2 java: ${{ env.PUBLISH_JDK }} token: ${{ secrets.GITHUB_TOKEN }} arguments: publishToSonatype --no-configuration-cache diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4e648d585d..99b2b5d28f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -55,7 +55,7 @@ jobs: uses: Wandalen/wretry.action@1a10d4835a1506f513ad8e7488aeb474ab20055c # v1.4.10 timeout-minutes: 5 with: - action: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 + action: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: | distribution: temurin java-version: ${{ env.JAVA_VERSION }} diff --git a/.github/workflows/dependency-submission-pr-submit.yml b/.github/workflows/dependency-submission-pr-submit.yml index 666164976a..46a2c50de5 100644 --- a/.github/workflows/dependency-submission-pr-submit.yml +++ b/.github/workflows/dependency-submission-pr-submit.yml @@ -36,7 +36,7 @@ jobs: uses: Wandalen/wretry.action@1a10d4835a1506f513ad8e7488aeb474ab20055c # v1.4.10 timeout-minutes: 5 with: - action: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 + action: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: | cache: gradle distribution: temurin diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml index ac81a3035e..3306cf7cfb 100644 --- a/.github/workflows/dependency-submission.yml +++ b/.github/workflows/dependency-submission.yml @@ -36,7 +36,7 @@ jobs: uses: Wandalen/wretry.action@1a10d4835a1506f513ad8e7488aeb474ab20055c # v1.4.10 timeout-minutes: 5 with: - action: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 + action: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: | cache: gradle distribution: temurin diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index f705ec17fb..b43b86c010 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -37,7 +37,7 @@ jobs: uses: Wandalen/wretry.action@1a10d4835a1506f513ad8e7488aeb474ab20055c # v1.4.10 timeout-minutes: 5 with: - action: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 + action: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: | distribution: temurin java-version: ${{ env.JAVA_VERSION }} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ff99b9ea4e..d1bc9f1f9f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] asm = "9.6" auto-value = "1.10.4" -awaitility = "4.2.0" +awaitility = "4.2.1" bcel = "6.8.2" bnd = "7.0.0" bouncycastle-jdk15on = "1.70" @@ -25,7 +25,7 @@ eclipse-collections = "12.0.0.M3" ehcache3 = "3.10.8" errorprone-core = "2.26.1" errorprone-plugin = "3.1.0" -errorprone-support = "0.16.0" +errorprone-support = "0.16.1" expiring-map = "0.5.11" fast-filter = "1.0.2" fastutil = "8.5.13" @@ -41,7 +41,7 @@ h2 = "2.2.224" hamcrest = "2.2" hazelcast = "5.3.6" httpclient = "4.5.14" -idea = "1.1.7" +idea = "1.1.8" jackrabbit = "1.60.0" jackson = "2.17.0" jacoco = "0.8.11"