From 4f616f683ae45d814f0dd7eeca969c314639ed5d Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Tue, 18 Jan 2022 10:52:22 -0700 Subject: [PATCH] Include github.run_attempt in test cache keys This change to the integration tests should properly isolate multiple runs of the same job. Previously, some jobs would fail if you attempted to re-run them via the UI, because the cache entries would be re-used from the previous run. --- .github/workflows/failure-cases.yml | 2 +- .github/workflows/integTest-action-inputs.yml | 2 +- .github/workflows/integTest-caching-config.yml | 2 +- .../integTest-caching-configuration-cache.yml | 12 ++++++------ .github/workflows/integTest-caching-gradle-home.yml | 2 +- .../workflows/integTest-caching-java-toolchain.yml | 2 +- .../workflows/integTest-execution-with-caching.yml | 2 +- .github/workflows/integTest-execution.yml | 2 +- .github/workflows/integTest-gradle-user-home.yml | 2 +- .github/workflows/integTest-gradle-versions.yml | 2 +- .github/workflows/integTest-sample-gradle-plugin.yml | 2 +- .github/workflows/integTest-sample-kotlin-dsl.yml | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/failure-cases.yml b/.github/workflows/failure-cases.yml index 038d2b04..a1a53c5f 100644 --- a/.github/workflows/failure-cases.yml +++ b/.github/workflows/failure-cases.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: diff --git a/.github/workflows/integTest-action-inputs.yml b/.github/workflows/integTest-action-inputs.yml index 8d197de5..3f8f7f13 100644 --- a/.github/workflows/integTest-action-inputs.yml +++ b/.github/workflows/integTest-action-inputs.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: action-inputs: diff --git a/.github/workflows/integTest-caching-config.yml b/.github/workflows/integTest-caching-config.yml index 7b521aae..2557081e 100644 --- a/.github/workflows/integTest-caching-config.yml +++ b/.github/workflows/integTest-caching-config.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true jobs: diff --git a/.github/workflows/integTest-caching-configuration-cache.yml b/.github/workflows/integTest-caching-configuration-cache.yml index ad65c03e..61267080 100644 --- a/.github/workflows/integTest-caching-configuration-cache.yml +++ b/.github/workflows/integTest-caching-configuration-cache.yml @@ -14,7 +14,7 @@ jobs: # These builds should start fresh without cache hits, due to the seed injected into the cache key above. seed-build-groovy: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-groovy- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-groovy- strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -30,7 +30,7 @@ jobs: configuration-cache-groovy: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-groovy- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-groovy- needs: seed-build-groovy strategy: matrix: @@ -52,7 +52,7 @@ jobs: # Check that the build can run when no extracted cache entries are restored no-extracted-cache-entries-restored: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-groovy- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-groovy- needs: seed-build-groovy strategy: matrix: @@ -73,7 +73,7 @@ jobs: seed-build-kotlin: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-kotlin- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-kotlin- strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -89,7 +89,7 @@ jobs: modify-build-kotlin: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-kotlin- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-kotlin- needs: seed-build-kotlin strategy: matrix: @@ -107,7 +107,7 @@ jobs: # Test restore configuration-cache from the third build invocation configuration-cache-kotlin: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-kotlin- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-kotlin- needs: modify-build-kotlin strategy: matrix: diff --git a/.github/workflows/integTest-caching-gradle-home.yml b/.github/workflows/integTest-caching-gradle-home.yml index 0e0656e6..79f089d7 100644 --- a/.github/workflows/integTest-caching-gradle-home.yml +++ b/.github/workflows/integTest-caching-gradle-home.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: seed-build: diff --git a/.github/workflows/integTest-caching-java-toolchain.yml b/.github/workflows/integTest-caching-java-toolchain.yml index 05288fd9..aded20cb 100644 --- a/.github/workflows/integTest-caching-java-toolchain.yml +++ b/.github/workflows/integTest-caching-java-toolchain.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: seed-build: diff --git a/.github/workflows/integTest-execution-with-caching.yml b/.github/workflows/integTest-execution-with-caching.yml index 1b808611..0c1dd838 100644 --- a/.github/workflows/integTest-execution-with-caching.yml +++ b/.github/workflows/integTest-execution-with-caching.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: seed-build: diff --git a/.github/workflows/integTest-execution.yml b/.github/workflows/integTest-execution.yml index a939d203..38dbdac6 100644 --- a/.github/workflows/integTest-execution.yml +++ b/.github/workflows/integTest-execution.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: # Tests for executing with different Gradle versions. diff --git a/.github/workflows/integTest-gradle-user-home.yml b/.github/workflows/integTest-gradle-user-home.yml index 47cd34fc..8623bf3f 100644 --- a/.github/workflows/integTest-gradle-user-home.yml +++ b/.github/workflows/integTest-gradle-user-home.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- GRADLE_USER_HOME: ${{github.workspace}}/custom/gradle/home jobs: diff --git a/.github/workflows/integTest-gradle-versions.yml b/.github/workflows/integTest-gradle-versions.yml index 628b5542..1c7b3f26 100644 --- a/.github/workflows/integTest-gradle-versions.yml +++ b/.github/workflows/integTest-gradle-versions.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- jobs: # Tests for executing with different Gradle versions. diff --git a/.github/workflows/integTest-sample-gradle-plugin.yml b/.github/workflows/integTest-sample-gradle-plugin.yml index 148ac128..69e5ce26 100644 --- a/.github/workflows/integTest-sample-gradle-plugin.yml +++ b/.github/workflows/integTest-sample-gradle-plugin.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true jobs: diff --git a/.github/workflows/integTest-sample-kotlin-dsl.yml b/.github/workflows/integTest-sample-kotlin-dsl.yml index c9b7655b..cfe3f23e 100644 --- a/.github/workflows/integTest-sample-kotlin-dsl.yml +++ b/.github/workflows/integTest-sample-kotlin-dsl.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}- + GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}- GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true jobs: