Skip to content

Commit cf6ec78

Browse files
committed
feat(actions): add actions/cache@v4
1 parent 5a8f92f commit cf6ec78

File tree

12 files changed

+383
-6
lines changed

12 files changed

+383
-6
lines changed

actions/actions/cache/v4/action

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
13aacd865c20de90d75de3b17ebe84f7a17d57d2

actions/actions/cache/v4/restore/action

Whitespace-only changes.

actions/actions/cache/v4/save/action

Whitespace-only changes.

docs/supported-actions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Click on a version to see the binding's code.
1313
* [clippy-check](https://github.com/actions-rs/clippy-check) - v1: [`ClippyCheckV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actionsrs/ClippyCheckV1.kt)
1414
* [toolchain](https://github.com/actions-rs/toolchain) - v1: [`ToolchainV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actionsrs/ToolchainV1.kt)
1515
* actions
16-
* [cache/restore](https://github.com/actions/cache/tree/v3/restore) - v3: [`CacheRestoreV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheRestoreV3.kt)
17-
* [cache/save](https://github.com/actions/cache/tree/v3/save) - v3: [`CacheSaveV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheSaveV3.kt)
18-
* [cache](https://github.com/actions/cache) - v2: [`CacheV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV2.kt), v3: [`CacheV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV3.kt)
16+
* [cache/restore](https://github.com/actions/cache/tree/v3/restore) - v3: [`CacheRestoreV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheRestoreV3.kt), v4: [`CacheRestoreV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheRestoreV4.kt)
17+
* [cache/save](https://github.com/actions/cache/tree/v3/save) - v3: [`CacheSaveV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheSaveV3.kt), v4: [`CacheSaveV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheSaveV4.kt)
18+
* [cache](https://github.com/actions/cache) - v2: [`CacheV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV2.kt), v3: [`CacheV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV3.kt), v4: [`CacheV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV4.kt)
1919
* [checkout](https://github.com/actions/checkout) - v2: [`CheckoutV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV2.kt), v3: [`CheckoutV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV3.kt), v4: [`CheckoutV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV4.kt)
2020
* [create-release](https://github.com/actions/create-release) - v1: [`CreateReleaseV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CreateReleaseV1.kt)
2121
* [download-artifact](https://github.com/actions/download-artifact) - v2: [`DownloadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV2.kt), v3: [`DownloadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV3.kt), v4: [`DownloadArtifactV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV4.kt)
@@ -140,6 +140,6 @@ Click on a version to see the binding's code.
140140
Number of bindings available:
141141

142142
* counting by actions: 84
143-
* counting each version separately: 144
143+
* counting each version separately: 147
144144

145145
Actions [providing typings](https://github.com/typesafegithub/github-actions-typing/) (marked with ✅ on the above list): 18

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheRestoreV3.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@file:Suppress(
55
"DataClassPrivateConstructor",
66
"UNUSED_PARAMETER",
7+
"DEPRECATION",
78
)
89

910
package io.github.typesafegithub.workflows.actions.actions
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
1415
import kotlin.Boolean
16+
import kotlin.Deprecated
1517
import kotlin.String
1618
import kotlin.Suppress
1719
import kotlin.Unit
@@ -41,6 +43,10 @@ import kotlin.collections.toTypedArray
4143
* @param _customVersion Allows overriding action's version, for example to use a specific minor
4244
* version, or a newer version that the binding doesn't yet know about
4345
*/
46+
@Deprecated(
47+
message = "This action has a newer major version: CacheRestoreV4",
48+
replaceWith = ReplaceWith("CacheRestoreV4"),
49+
)
4450
public data class CacheRestoreV3 private constructor(
4551
/**
4652
* A list of files, directories, and wildcard patterns to restore
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
2+
// changes will be overwritten with the next binding code regeneration.
3+
// See https://github.com/typesafegithub/github-workflows-kt for more info.
4+
@file:Suppress(
5+
"DataClassPrivateConstructor",
6+
"UNUSED_PARAMETER",
7+
)
8+
9+
package io.github.typesafegithub.workflows.actions.actions
10+
11+
import io.github.typesafegithub.workflows.domain.actions.Action
12+
import io.github.typesafegithub.workflows.domain.actions.RegularAction
13+
import java.util.LinkedHashMap
14+
import kotlin.Boolean
15+
import kotlin.String
16+
import kotlin.Suppress
17+
import kotlin.Unit
18+
import kotlin.collections.List
19+
import kotlin.collections.Map
20+
import kotlin.collections.toList
21+
import kotlin.collections.toTypedArray
22+
23+
/**
24+
* Action: Restore Cache
25+
*
26+
* Restore Cache artifacts like dependencies and build outputs to improve workflow execution time
27+
*
28+
* [Action on GitHub](https://github.com/actions/cache/tree/v4/restore)
29+
*
30+
* @param path A list of files, directories, and wildcard patterns to restore
31+
* @param key An explicit key for restoring the cache
32+
* @param restoreKeys An ordered list of keys to use for restoring stale cache if no cache hit
33+
* occurred for key. Note `cache-hit` returns false in this case.
34+
* @param enableCrossOsArchive An optional boolean when enabled, allows windows runners to restore
35+
* caches that were saved on other platforms
36+
* @param failOnCacheMiss Fail the workflow if cache entry is not found
37+
* @param lookupOnly Check if a cache entry exists for the given input(s) (key, restore-keys)
38+
* without downloading the cache
39+
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
40+
* the binding
41+
* @param _customVersion Allows overriding action's version, for example to use a specific minor
42+
* version, or a newer version that the binding doesn't yet know about
43+
*/
44+
public data class CacheRestoreV4 private constructor(
45+
/**
46+
* A list of files, directories, and wildcard patterns to restore
47+
*/
48+
public val path: List<String>,
49+
/**
50+
* An explicit key for restoring the cache
51+
*/
52+
public val key: String,
53+
/**
54+
* An ordered list of keys to use for restoring stale cache if no cache hit occurred for key.
55+
* Note `cache-hit` returns false in this case.
56+
*/
57+
public val restoreKeys: List<String>? = null,
58+
/**
59+
* An optional boolean when enabled, allows windows runners to restore caches that were saved on
60+
* other platforms
61+
*/
62+
public val enableCrossOsArchive: Boolean? = null,
63+
/**
64+
* Fail the workflow if cache entry is not found
65+
*/
66+
public val failOnCacheMiss: Boolean? = null,
67+
/**
68+
* Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading
69+
* the cache
70+
*/
71+
public val lookupOnly: Boolean? = null,
72+
/**
73+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
74+
*/
75+
public val _customInputs: Map<String, String> = mapOf(),
76+
/**
77+
* Allows overriding action's version, for example to use a specific minor version, or a newer
78+
* version that the binding doesn't yet know about
79+
*/
80+
public val _customVersion: String? = null,
81+
) : RegularAction<CacheRestoreV4.Outputs>("actions", "cache/restore", _customVersion ?: "v4") {
82+
public constructor(
83+
vararg pleaseUseNamedArguments: Unit,
84+
path: List<String>,
85+
key: String,
86+
restoreKeys: List<String>? = null,
87+
enableCrossOsArchive: Boolean? = null,
88+
failOnCacheMiss: Boolean? = null,
89+
lookupOnly: Boolean? = null,
90+
_customInputs: Map<String, String> = mapOf(),
91+
_customVersion: String? = null,
92+
) : this(path=path, key=key, restoreKeys=restoreKeys, enableCrossOsArchive=enableCrossOsArchive,
93+
failOnCacheMiss=failOnCacheMiss, lookupOnly=lookupOnly, _customInputs=_customInputs,
94+
_customVersion=_customVersion)
95+
96+
@Suppress("SpreadOperator")
97+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
98+
*listOfNotNull(
99+
"path" to path.joinToString("\n"),
100+
"key" to key,
101+
restoreKeys?.let { "restore-keys" to it.joinToString("\n") },
102+
enableCrossOsArchive?.let { "enableCrossOsArchive" to it.toString() },
103+
failOnCacheMiss?.let { "fail-on-cache-miss" to it.toString() },
104+
lookupOnly?.let { "lookup-only" to it.toString() },
105+
*_customInputs.toList().toTypedArray(),
106+
).toTypedArray()
107+
)
108+
109+
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
110+
111+
public class Outputs(
112+
stepId: String,
113+
) : Action.Outputs(stepId) {
114+
/**
115+
* A boolean value to indicate an exact match was found for the primary key
116+
*/
117+
public val cacheHit: String = "steps.$stepId.outputs.cache-hit"
118+
119+
/**
120+
* A resolved cache key for which cache match was attempted
121+
*/
122+
public val cachePrimaryKey: String = "steps.$stepId.outputs.cache-primary-key"
123+
124+
/**
125+
* Key of the cache that was restored, it could either be the primary key on cache-hit or a
126+
* partial/complete match of one of the restore keys
127+
*/
128+
public val cacheMatchedKey: String = "steps.$stepId.outputs.cache-matched-key"
129+
}
130+
}

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheSaveV3.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@file:Suppress(
55
"DataClassPrivateConstructor",
66
"UNUSED_PARAMETER",
7+
"DEPRECATION",
78
)
89

910
package io.github.typesafegithub.workflows.actions.actions
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
1415
import kotlin.Boolean
16+
import kotlin.Deprecated
1517
import kotlin.Int
1618
import kotlin.String
1719
import kotlin.Suppress
@@ -38,6 +40,10 @@ import kotlin.collections.toTypedArray
3840
* @param _customVersion Allows overriding action's version, for example to use a specific minor
3941
* version, or a newer version that the binding doesn't yet know about
4042
*/
43+
@Deprecated(
44+
message = "This action has a newer major version: CacheSaveV4",
45+
replaceWith = ReplaceWith("CacheSaveV4"),
46+
)
4147
public data class CacheSaveV3 private constructor(
4248
/**
4349
* A list of files, directories, and wildcard patterns to cache
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
2+
// changes will be overwritten with the next binding code regeneration.
3+
// See https://github.com/typesafegithub/github-workflows-kt for more info.
4+
@file:Suppress(
5+
"DataClassPrivateConstructor",
6+
"UNUSED_PARAMETER",
7+
)
8+
9+
package io.github.typesafegithub.workflows.actions.actions
10+
11+
import io.github.typesafegithub.workflows.domain.actions.Action
12+
import io.github.typesafegithub.workflows.domain.actions.RegularAction
13+
import java.util.LinkedHashMap
14+
import kotlin.Boolean
15+
import kotlin.Int
16+
import kotlin.String
17+
import kotlin.Suppress
18+
import kotlin.Unit
19+
import kotlin.collections.List
20+
import kotlin.collections.Map
21+
import kotlin.collections.toList
22+
import kotlin.collections.toTypedArray
23+
24+
/**
25+
* Action: Save a cache
26+
*
27+
* Save Cache artifacts like dependencies and build outputs to improve workflow execution time
28+
*
29+
* [Action on GitHub](https://github.com/actions/cache/tree/v4/save)
30+
*
31+
* @param path A list of files, directories, and wildcard patterns to cache
32+
* @param key An explicit key for saving the cache
33+
* @param uploadChunkSize The chunk size used to split up large files during upload, in bytes
34+
* @param enableCrossOsArchive An optional boolean when enabled, allows windows runners to save
35+
* caches that can be restored on other platforms
36+
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
37+
* the binding
38+
* @param _customVersion Allows overriding action's version, for example to use a specific minor
39+
* version, or a newer version that the binding doesn't yet know about
40+
*/
41+
public data class CacheSaveV4 private constructor(
42+
/**
43+
* A list of files, directories, and wildcard patterns to cache
44+
*/
45+
public val path: List<String>,
46+
/**
47+
* An explicit key for saving the cache
48+
*/
49+
public val key: String,
50+
/**
51+
* The chunk size used to split up large files during upload, in bytes
52+
*/
53+
public val uploadChunkSize: Int? = null,
54+
/**
55+
* An optional boolean when enabled, allows windows runners to save caches that can be restored
56+
* on other platforms
57+
*/
58+
public val enableCrossOsArchive: Boolean? = null,
59+
/**
60+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
61+
*/
62+
public val _customInputs: Map<String, String> = mapOf(),
63+
/**
64+
* Allows overriding action's version, for example to use a specific minor version, or a newer
65+
* version that the binding doesn't yet know about
66+
*/
67+
public val _customVersion: String? = null,
68+
) : RegularAction<Action.Outputs>("actions", "cache/save", _customVersion ?: "v4") {
69+
public constructor(
70+
vararg pleaseUseNamedArguments: Unit,
71+
path: List<String>,
72+
key: String,
73+
uploadChunkSize: Int? = null,
74+
enableCrossOsArchive: Boolean? = null,
75+
_customInputs: Map<String, String> = mapOf(),
76+
_customVersion: String? = null,
77+
) : this(path=path, key=key, uploadChunkSize=uploadChunkSize,
78+
enableCrossOsArchive=enableCrossOsArchive, _customInputs=_customInputs,
79+
_customVersion=_customVersion)
80+
81+
@Suppress("SpreadOperator")
82+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
83+
*listOfNotNull(
84+
"path" to path.joinToString("\n"),
85+
"key" to key,
86+
uploadChunkSize?.let { "upload-chunk-size" to it.toString() },
87+
enableCrossOsArchive?.let { "enableCrossOsArchive" to it.toString() },
88+
*_customInputs.toList().toTypedArray(),
89+
).toTypedArray()
90+
)
91+
92+
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
93+
}

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV2.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ import kotlin.collections.toTypedArray
4040
* version, or a newer version that the binding doesn't yet know about
4141
*/
4242
@Deprecated(
43-
message = "This action has a newer major version: CacheV3",
44-
replaceWith = ReplaceWith("CacheV3"),
43+
message = "This action has a newer major version: CacheV4",
44+
replaceWith = ReplaceWith("CacheV4"),
4545
)
4646
public data class CacheV2 private constructor(
4747
/**

0 commit comments

Comments
 (0)