1
0
Fork 0
mirror of https://github.com/gradle/gradle-build-action.git synced 2025-04-07 22:04:14 +02:00

Rename the 'wrapper-cache-enabled' flag to 'distributions-cache-enabled'

This commit is contained in:
Daz DeBoer 2021-07-05 17:47:14 -06:00
parent 4edc9657af
commit 241d9c1df0
No known key found for this signature in database
GPG key ID: 70F584A28F2230E8
6 changed files with 14 additions and 14 deletions

View file

@ -122,7 +122,7 @@ jobs:
This action provides 3 levels of caching to help speed up your GitHub Actions:
- `wrapper` caches the local [wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) installation, saving time downloading and unpacking Gradle distributions ;
- `distributions` caches the any downloaded Gradle zips, including any downloaded [wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) versions, saving time downloading and unpacking Gradle distributions ;
- `dependencies` caches the [dependencies](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:cache_copy), saving time downloading dependencies ;
- `configuration` caches the [build configuration](https://docs.gradle.org/nightly/userguide/configuration_cache.html), saving time configuring the build.
@ -132,12 +132,12 @@ Future versions of this action will enable all caching by default.
You can control which level is enabled as follows:
```yaml
wrapper-cache-enabled: true
distributions-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
```
The wrapper installation cache is simple and can't be configured further.
The distributions cache is simple and can't be configured further.
The dependencies and configuration cache will compute a cache key in a best effort manner.
Keep reading to learn how to better control how they work.

View file

@ -17,8 +17,8 @@ inputs:
arguments:
description: Gradle command line arguments, see gradle --help
required: false
wrapper-cache-enabled:
description: Whether caching wrapper installation is enabled or not, default to 'true'
distributions-cache-enabled:
description: Whether caching downloaded Gradle distributions is enabled or not, default to 'true'
required: false
dependencies-cache-enabled:
description: Whether caching dependencies is enabled or not, default to 'false'

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,7 @@ const WRAPPER_SLUG = 'WRAPPER_SLUG'
export async function restoreCachedWrapperDist(
gradlewDirectory: string | null
): Promise<void> {
if (isWrapperCacheDisabled()) return
if (isDistributionsCacheDisabled()) return
if (gradlewDirectory == null) return
const wrapperProperties = path.join(
@ -56,7 +56,7 @@ export async function restoreCachedWrapperDist(
}
export async function cacheWrapperDist(): Promise<void> {
if (isWrapperCacheDisabled()) return
if (isDistributionsCacheDisabled()) return
const wrapperSlug = core.getState(WRAPPER_SLUG)
if (!wrapperSlug) return
@ -106,8 +106,8 @@ export function extractGradleWrapperSlugFromDistUri(
return match ? match[1] : null
}
function isWrapperCacheDisabled(): boolean {
return !github.inputBoolean('wrapper-cache-enabled', true)
function isDistributionsCacheDisabled(): boolean {
return !github.inputBoolean('distributions-cache-enabled', true)
}
function getCacheKey(wrapperSlug: string): string {

View file

@ -111,7 +111,7 @@ async function downloadAndCacheGradleDistribution(
`gradle-installations/downloads/gradle-${versionInfo.version}-bin.zip`
)
if (isDistributionCacheDisabled()) {
if (isDistributionsCacheDisabled()) {
await downloadGradleDistribution(versionInfo, downloadPath)
return downloadPath
}
@ -173,8 +173,8 @@ async function httpGetString(url: string): Promise<string> {
return response.readBody()
}
function isDistributionCacheDisabled(): boolean {
return !github.inputBoolean('wrapper-cache-enabled', true)
function isDistributionsCacheDisabled(): boolean {
return !github.inputBoolean('distributions-cache-enabled', true)
}
interface GradleVersionInfo {