Skip to content

Commit

Permalink
[typesafegithub#641] feat(actions): add burrunan/gradle-cache-action@v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire authored and krzema12 committed Jan 24, 2023
1 parent 70078b4 commit cffc361
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 3 deletions.
1 change: 1 addition & 0 deletions actions/burrunan/gradle-cache-action/v1/commit-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dcdf4fa133ebcf5f48c5513317ae5afcd345efbd
Empty file.
8 changes: 5 additions & 3 deletions docs/supported-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Click on a version to see the wrapper's code.
* [npm-install](https://github.com/bahmutov/npm-install) - v1: [`NpmInstallV1`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/bahmutov/NpmInstallV1.kt)
* Borales
* [actions-yarn](https://github.com/Borales/actions-yarn) - v3: [`ActionsYarnV3`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/borales/ActionsYarnV3.kt), v4: [`ActionsYarnV4`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/borales/ActionsYarnV4.kt)
* burrunan
* [gradle-cache-action](https://github.com/burrunan/gradle-cache-action) - v1 ✅: [`GradleCacheActionV1`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/burrunan/GradleCacheActionV1.kt)
* c2corg
* [browserslist-update-action](https://github.com/c2corg/browserslist-update-action) - v2 ✅: [`BrowserslistUpdateActionV2`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/c2corg/BrowserslistUpdateActionV2.kt)
* [transifex-pull-request-action](https://github.com/c2corg/transifex-pull-request-action) - v5 ✅: [`TransifexPullRequestActionV5`](https://github.com/krzema12/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/it/krzeminski/githubactions/actions/c2corg/TransifexPullRequestActionV5.kt)
Expand Down Expand Up @@ -120,7 +122,7 @@ Click on a version to see the wrapper's code.

Number of wrappers available:

* counting by actions: 70
* counting each version separately: 92
* counting by actions: 71
* counting each version separately: 93

Actions [providing typings](https://github.com/krzema12/github-actions-typing/) (marked with ✅ on the above list): 10
Actions [providing typings](https://github.com/krzema12/github-actions-typing/) (marked with ✅ on the above list): 11
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
// This file was generated using 'wrapper-generator' module. Don't change it by hand, your changes will
// be overwritten with the next wrapper code regeneration. Instead, consider introducing changes to the
// generator itself.
package it.krzeminski.githubactions.actions.burrunan

import it.krzeminski.githubactions.actions.ActionWithOutputs
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray

/**
* Action: Gradle Cache
*
* Caches .gradle folder (dependencies, local build cache, ...)
*
* [Action on GitHub](https://github.com/burrunan/gradle-cache-action)
*/
public class GradleCacheActionV1(
/**
* A job identifier to avoid cache pollution from different jobs
*/
public val jobId: String? = null,
/**
* Relative path under $GITHUB_WORKSPACE where Git repository is placed
*/
public val buildRootDirectory: String? = null,
/**
* Overrides the location of $HOME (e.g. to avoid use of /root when running in Docker)
*/
public val homeDirectory: String? = null,
/**
* (wrapper | or explicit version) Caches often depend on the Gradle version, so this parameter
* sets the ID to use for cache keys. It does not affect the Gradle version used for build
*/
public val gradleVersion: String? = null,
/**
* Configures caches for read-only opreration (e.g. to save GitHub Actions storage limit)
*/
public val readOnly: Boolean? = null,
/**
* Enables caching of $HOME/.gradle/caches/*.*/generated-gradle-jars
*/
public val saveGeneratedGradleJars: Boolean? = null,
/**
* Enables caching of $HOME/.gradle/caches/build-cache-1
*/
public val saveLocalBuildCache: Boolean? = null,
/**
* Adds com.github.burrunan.multi-cache plugin to settings.gradle so GitHub Actions cache can be
* used in parallel with Gradle remote build cache
*/
public val multiCacheEnabled: Boolean? = null,
/**
* Configures com.github.burrunan.multi-cache version to use
*/
public val multiCacheVersion: String? = null,
/**
* Configures repository where com.github.burrunan.multi-cache can be located
*/
public val multiCacheRepository: String? = null,
/**
* Configures group id for selecting only com.github.burrunan.multi-cache artifacts (it enables
* Gradle to use custom repository for multi-cache only)
*/
public val multiCacheGroupIdFilter: String? = null,
/**
* Enables caching of ~/.gradle/caches/modules-*
*/
public val saveGradleDependenciesCache: Boolean? = null,
/**
* Activates only the caches that are relevant for executing gradle command.
* This is helpful when build job executes multiple gradle commands sequentially.
* Then the caching is implemented in the very first one, and the subsequent should be marked
* with execution-only-caches: true
*/
public val executionOnlyCaches: Boolean? = null,
/**
* Activates a remote cache that proxies requests to GitHub Actions cache
*/
public val remoteBuildCacheProxyEnabled: Boolean? = null,
/**
* Extra files to take into account for ~/.gradle/caches dependencies
*/
public val gradleDependenciesCacheKey: String? = null,
/**
* Enables caching of ~/.m2/repository/
*/
public val saveMavenDependenciesCache: Boolean? = null,
/**
* Specifies ignored paths in the Maven Local repository (e.g. the artifacts of the current
* project)
*/
public val mavenLocalIgnorePaths: String? = null,
/**
* Shows extra logging to debug the action
*/
public val debug: Boolean? = null,
/**
* Enables concurent cache download and upload (disabled by default for better log output)
*/
public val concurrent: Boolean? = null,
/**
* Gradle arguments to pass (optionally multiline)
*/
public val arguments: String? = null,
/**
* Extra Gradle properties (multiline) which would be passed as -Pname=value arguments
*/
public val properties: String? = null,
/**
* Publishes Gradle Build Scan URL to job report.
*/
public val gradleBuildScanReport: Boolean? = null,
/**
* Enables warning when distributionSha256Sum property is missing in gradle-wrapper.properties
*/
public val gradleDistributionSha256SumWarning: Boolean? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the wrapper
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the wrapper doesn't yet know about
*/
_customVersion: String? = null,
) : ActionWithOutputs<GradleCacheActionV1.Outputs>("burrunan", "gradle-cache-action", _customVersion
?: "v1") {
@Suppress("SpreadOperator")
public override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
jobId?.let { "job-id" to it },
buildRootDirectory?.let { "build-root-directory" to it },
homeDirectory?.let { "home-directory" to it },
gradleVersion?.let { "gradle-version" to it },
readOnly?.let { "read-only" to it.toString() },
saveGeneratedGradleJars?.let { "save-generated-gradle-jars" to it.toString() },
saveLocalBuildCache?.let { "save-local-build-cache" to it.toString() },
multiCacheEnabled?.let { "multi-cache-enabled" to it.toString() },
multiCacheVersion?.let { "multi-cache-version" to it },
multiCacheRepository?.let { "multi-cache-repository" to it },
multiCacheGroupIdFilter?.let { "multi-cache-group-id-filter" to it },
saveGradleDependenciesCache?.let { "save-gradle-dependencies-cache" to it.toString() },
executionOnlyCaches?.let { "execution-only-caches" to it.toString() },
remoteBuildCacheProxyEnabled?.let { "remote-build-cache-proxy-enabled" to it.toString()
},
gradleDependenciesCacheKey?.let { "gradle-dependencies-cache-key" to it },
saveMavenDependenciesCache?.let { "save-maven-dependencies-cache" to it.toString() },
mavenLocalIgnorePaths?.let { "maven-local-ignore-paths" to it },
debug?.let { "debug" to it.toString() },
concurrent?.let { "concurrent" to it.toString() },
arguments?.let { "arguments" to it },
properties?.let { "properties" to it },
gradleBuildScanReport?.let { "gradle-build-scan-report" to it.toString() },
gradleDistributionSha256SumWarning?.let { "gradle-distribution-sha-256-sum-warning" to
it.toString() },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)

public override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)

public class Outputs(
private val stepId: String,
) {
/**
* Link to the build scan if any
*/
public val buildScanUrl: String = "steps.$stepId.outputs.build-scan-url"

public operator fun `get`(outputName: String): String = "steps.$stepId.outputs.$outputName"
}
}

0 comments on commit cffc361

Please # to comment.