mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Fix check for config-cache usage
Now that environment variable reads are auto-detected by Gradle 7.4, we need a different mechanism to check that the configuration cache is being used successfully.
This commit is contained in:
parent
b10e7caf66
commit
53af4d4f57
3 changed files with 23 additions and 14 deletions
|
@ -11,10 +11,9 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks.named("test").configure {
|
||||
// Use an environment variable to bypass config-cache checks
|
||||
if (System.getenv('VERIFY_CACHED_CONFIGURATION') != null) {
|
||||
throw new RuntimeException("Configuration was not cached: unexpected configuration of test task")
|
||||
}
|
||||
// Echo an output value so we can detect configuration-cache usage
|
||||
println "::set-output name=task_configured::yes"
|
||||
|
||||
doLast {
|
||||
if (System.properties.verifyCachedBuild) {
|
||||
throw new RuntimeException("Build was not cached: unexpected execution of test task")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue