Open lhstrh opened 2 years ago
Adding this should do the trick:
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
I recall we were using this action in the past but stopped using it because of other problems. Maybe @petervdonovan remembers?
I recall we were using this action in the past but stopped using it because of other problems.
No, I do not remember any such incident in relation to Gradle. Something like that happened with PNPM lockfiles, but not with Gradle. If anything, I might vaguely remember arguing against caching the Gradle caches, because I was not aware of the connection problem mentioned in this issue.
The new caching config doesn't solve this problem, but hopefully #2023 does.
At times,
./gradlew
fails because it is unable to download Gradle and throws errors like the following:Perhaps we should add an action that repeatedly tries to invoke
./gradlew tasks
(which would trigger the installation of Gradle if that hadn't yet happened). Alternatively, we could use a caching strategy to lessen the frequency at which Gradle gets downloaded in the first place.