mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-04-08 06:14:14 +02:00
Rename the 'wrapper-cache-enabled' flag to 'distributions-cache-enabled'
This commit is contained in:
parent
4edc9657af
commit
241d9c1df0
6 changed files with 14 additions and 14 deletions
|
@ -122,7 +122,7 @@ jobs:
|
||||||
|
|
||||||
This action provides 3 levels of caching to help speed up your GitHub Actions:
|
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 ;
|
- `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.
|
- `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:
|
You can control which level is enabled as follows:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
wrapper-cache-enabled: true
|
distributions-cache-enabled: true
|
||||||
dependencies-cache-enabled: true
|
dependencies-cache-enabled: true
|
||||||
configuration-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.
|
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.
|
Keep reading to learn how to better control how they work.
|
||||||
|
|
|
@ -17,8 +17,8 @@ inputs:
|
||||||
arguments:
|
arguments:
|
||||||
description: Gradle command line arguments, see gradle --help
|
description: Gradle command line arguments, see gradle --help
|
||||||
required: false
|
required: false
|
||||||
wrapper-cache-enabled:
|
distributions-cache-enabled:
|
||||||
description: Whether caching wrapper installation is enabled or not, default to 'true'
|
description: Whether caching downloaded Gradle distributions is enabled or not, default to 'true'
|
||||||
required: false
|
required: false
|
||||||
dependencies-cache-enabled:
|
dependencies-cache-enabled:
|
||||||
description: Whether caching dependencies is enabled or not, default to 'false'
|
description: Whether caching dependencies is enabled or not, default to 'false'
|
||||||
|
|
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js
vendored
2
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -12,7 +12,7 @@ const WRAPPER_SLUG = 'WRAPPER_SLUG'
|
||||||
export async function restoreCachedWrapperDist(
|
export async function restoreCachedWrapperDist(
|
||||||
gradlewDirectory: string | null
|
gradlewDirectory: string | null
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (isWrapperCacheDisabled()) return
|
if (isDistributionsCacheDisabled()) return
|
||||||
if (gradlewDirectory == null) return
|
if (gradlewDirectory == null) return
|
||||||
|
|
||||||
const wrapperProperties = path.join(
|
const wrapperProperties = path.join(
|
||||||
|
@ -56,7 +56,7 @@ export async function restoreCachedWrapperDist(
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cacheWrapperDist(): Promise<void> {
|
export async function cacheWrapperDist(): Promise<void> {
|
||||||
if (isWrapperCacheDisabled()) return
|
if (isDistributionsCacheDisabled()) return
|
||||||
|
|
||||||
const wrapperSlug = core.getState(WRAPPER_SLUG)
|
const wrapperSlug = core.getState(WRAPPER_SLUG)
|
||||||
if (!wrapperSlug) return
|
if (!wrapperSlug) return
|
||||||
|
@ -106,8 +106,8 @@ export function extractGradleWrapperSlugFromDistUri(
|
||||||
return match ? match[1] : null
|
return match ? match[1] : null
|
||||||
}
|
}
|
||||||
|
|
||||||
function isWrapperCacheDisabled(): boolean {
|
function isDistributionsCacheDisabled(): boolean {
|
||||||
return !github.inputBoolean('wrapper-cache-enabled', true)
|
return !github.inputBoolean('distributions-cache-enabled', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCacheKey(wrapperSlug: string): string {
|
function getCacheKey(wrapperSlug: string): string {
|
||||||
|
|
|
@ -111,7 +111,7 @@ async function downloadAndCacheGradleDistribution(
|
||||||
`gradle-installations/downloads/gradle-${versionInfo.version}-bin.zip`
|
`gradle-installations/downloads/gradle-${versionInfo.version}-bin.zip`
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isDistributionCacheDisabled()) {
|
if (isDistributionsCacheDisabled()) {
|
||||||
await downloadGradleDistribution(versionInfo, downloadPath)
|
await downloadGradleDistribution(versionInfo, downloadPath)
|
||||||
return downloadPath
|
return downloadPath
|
||||||
}
|
}
|
||||||
|
@ -173,8 +173,8 @@ async function httpGetString(url: string): Promise<string> {
|
||||||
return response.readBody()
|
return response.readBody()
|
||||||
}
|
}
|
||||||
|
|
||||||
function isDistributionCacheDisabled(): boolean {
|
function isDistributionsCacheDisabled(): boolean {
|
||||||
return !github.inputBoolean('wrapper-cache-enabled', true)
|
return !github.inputBoolean('distributions-cache-enabled', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GradleVersionInfo {
|
interface GradleVersionInfo {
|
||||||
|
|
Loading…
Add table
Reference in a new issue