You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-6Lines changed: 23 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ The `setup-java` action provides the following functionality for GitHub Actions
14
14
- Caching dependencies managed by Apache Maven.
15
15
- Caching dependencies managed by Gradle.
16
16
- Caching dependencies managed by sbt.
17
+
- Caching dependencies managed by Mill.
17
18
-[Maven Toolchains declaration](https://maven.apache.org/guides/mini/guide-using-toolchains.html) for specified JDK versions.
18
19
19
20
This action allows you to work with Java and Scala projects.
@@ -39,7 +40,7 @@ This action allows you to work with Java and Scala projects.
39
40
40
41
-`check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
41
42
42
-
-`cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle"or "sbt".
43
+
-`cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle", "sbt", or "mill".
43
44
44
45
-`cache-dependency-path`: The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used with the `cache` option. If this option is omitted, the action searches for the dependency file in the entire repository. This option supports wildcards and a list of file names for caching multiple dependencies.
45
46
@@ -121,19 +122,20 @@ Currently, the following distributions are supported:
121
122
**NOTE:** To comply with the GraalVM Free Terms and Conditions (GFTC) license, it is recommended to use GraalVM JDK 17 version 17.0.12, as this is the only version of GraalVM JDK 17 available under the GFTC license. Additionally, it is encouraged to consider upgrading to GraalVM JDK 21, which offers the latest features and improvements.
122
123
123
124
### Caching packages dependencies
124
-
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
125
+
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are Gradle, Maven, sbt, and Mill. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
125
126
126
-
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
127
-
- maven: `**/pom.xml`
127
+
- Gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
- Mill: `**/build.sc`, `**/*.sc`, `**/mill`, `**/.mill-version`, and `**/.config/mill-version`
129
131
130
132
When the option `cache-dependency-path` is specified, the hash is based on the matching file. This option supports wildcards and a list of file names, and is especially useful for monorepos.
131
133
132
134
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
133
135
134
136
The cache input is optional, and caching is turned off by default.
135
137
136
-
#### Caching gradle dependencies
138
+
#### Caching Gradle dependencies
137
139
```yaml
138
140
steps:
139
141
- uses: actions/checkout@v4
@@ -148,7 +150,7 @@ steps:
148
150
- run: ./gradlew build --no-daemon
149
151
```
150
152
151
-
#### Caching maven dependencies
153
+
#### Caching Maven dependencies
152
154
```yaml
153
155
steps:
154
156
- uses: actions/checkout@v4
@@ -178,6 +180,21 @@ steps:
178
180
run: sbt package
179
181
```
180
182
183
+
#### Caching Mill dependencies
184
+
```yaml
185
+
steps:
186
+
- uses: actions/checkout@v4
187
+
- uses: actions/setup-java@v4
188
+
with:
189
+
distribution: 'temurin'
190
+
java-version: '21'
191
+
cache: 'mill'
192
+
cache-dependency-path: | # optional
193
+
sub-project/build.sc
194
+
- name: Build with Mill
195
+
run: ./mill _.compile
196
+
```
197
+
181
198
#### Cache segment restore timeout
182
199
Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a segment download gets stuck, which causes the workflow job to be stuck. The cache segment download timeout [was introduced](https://github.com/actions/toolkit/tree/main/packages/cache#cache-segment-restore-timeout) to solve this issue as it allows the segment download to get aborted and hence allows the job to proceed with a cache miss. The default value of the cache segment download timeout is set to 10 minutes and can be customized by specifying an environment variable named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with a timeout value in minutes.
0 commit comments