0

In gradle.properties I'm setting

org.gradle.unsafe.configuration-cache=true

This works without errors on my local machine. The output is:

0 problems were found storing the configuration cache.

When I set up a job on GitHub Actions, it only succeeds if I deactivate the configuration cache. When it is activated I get this log:

3 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:app:buildKotlinToolingMetadata` of type `org.jetbrains.kotlin.gradle.tooling.BuildKotlinToolingMetadataTask$FromKotlinExtension`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

See the complete report at file:///home/runner/work/***/***/build/reports/configuration-cache/3lar58wlvtv9703t0m3olblg9/gwoz69d8l961obatzzelsv4d/configuration-cache-report.html

> Invocation of 'Task.project' by task ':app:buildKotlinToolingMetadata' at execution time is unsupported.

My primary interest is why this behaves differently.

I'm also wondering what the best workaround is. (Can tasks be skipped from caching? Or how would you deactivate the configuration cache on the CI server?)

Peter F
  • 3,633
  • 3
  • 33
  • 45

1 Answers1

1

I haven't understood the cause yet.

My current workaround is to disable the configuration cache on CI builds adding the option --no-configuration-cache to all gradle commands e.g.

./gradlew test --no-configuration-cache

This overwrites the setting of gradle.properties.

Peter F
  • 3,633
  • 3
  • 33
  • 45