burrunan / gradle-cache-action

GitHub Action to properly cache ~/.gradle folder
Apache License 2.0
150 stars 13 forks source link

No Cache is stored because nothing has been found #41

Closed eye2web closed 2 years ago

eye2web commented 3 years ago

Im getting to following messages during the POST step. I'm using version 1.10

Save gradle-generated-jars gradle-generated-jars: no files to cache => won't upload empty cache Save dependencies-gradle dependencies-gradle: creating single-layer cache image dependencies-gradle: no files to cache => won't upload empty cache Save dependencies-maven dependencies-maven: creating single-layer cache image dependencies-maven: no files to cache => won't upload empty cache

mcarrillowz commented 2 years ago

I'm having the same issue, @eye2web do you find a way to solve it?

I'm using the action like this:

      - uses: burrunan/gradle-cache-action@v1
        name: Test Coverage
        with:
          read-only: false
          arguments: :project:unitTestCoverageVerificationDebug
          concurrent: false
          gradle-build-scan-report: false
vlsi commented 2 years ago

@mcarrillowz would you share the link to the actions log?

mcarrillowz commented 2 years ago

@mcarrillowz would you share the link to the actions log?

The repo is private, but let me know what you want to see and I can share it

mcarrillowz commented 2 years ago

@vlsi It seems that I found the issue. I'm running the action within a container using the root user and the gradle cache goes to /root/.gradle/caches, but the action uses ~/.gradle/caches and ~ is resolved as /github/home/

Any plans to use an input to specify the .gradle path?

Reference: https://github.community/t/how-to-use-the-github-cache-action-in-a-containerized-workflow/219514/3

vlsi commented 2 years ago

@mcarrillowz , thank you for the analysis. I'll fix it tomorrow

vlsi commented 2 years ago

I've added home-directory: /path/to/home property in burrunan/gradle-cache-action@v1.11. It would be nice if you could check if it solves the issue