Skip to content

Commit da88328

Browse files
authored
Merge pull request #3 from japgolly/topic/inputs
Wire up all action inputs
2 parents 17ba6a1 + a514be5 commit da88328

File tree

2 files changed

+213
-6
lines changed

2 files changed

+213
-6
lines changed

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Use this:
99
uses: japgolly/[email protected]
1010
```
1111
12-
To replace this:
12+
To replace (a subset of) this:
1313
1414
```yaml
1515
- name: Setup Java and Scala
@@ -27,7 +27,35 @@ To replace this:
2727
2828
## Inputs
2929
30-
* `java-version` - The Java version to install. Defaults to `[email protected]`
31-
* `node-version` - The Node version to install. Defaults to `16`
32-
* `jsdom-version` - The `jsdom` version to install. Defaults to `latest`
33-
* `source-map-support-version` - The `source-map-support` version to install. Defaults to `latest`
30+
All inputs are optional.
31+
See [`actions.yml`](https://github.com/japgolly/setup-everything-scala/blob/master/action.yml) for descriptions and defaults.
32+
33+
* `coursier-cache-ammoniteScripts`
34+
* `coursier-cache-extraAmmoniteHashedContent`
35+
* `coursier-cache-extraAmmoniteKey`
36+
* `coursier-cache-extraFiles`
37+
* `coursier-cache-extraHashedContent`
38+
* `coursier-cache-extraKey`
39+
* `coursier-cache-extraMillFiles`
40+
* `coursier-cache-extraMillHashedContent`
41+
* `coursier-cache-extraMillKey`
42+
* `coursier-cache-extraSbtFiles`
43+
* `coursier-cache-extraSbtHashedContent`
44+
* `coursier-cache-extraSbtKey`
45+
* `coursier-cache-job`
46+
* `coursier-cache-matrix`
47+
* `coursier-cache-path`
48+
* `coursier-cache-root`
49+
* `jabba-version`
50+
* `java-version`
51+
* `jsdom-version`
52+
* `node-always-auth`
53+
* `node-architecture`
54+
* `node-cache-dependency-path`
55+
* `node-cache`
56+
* `node-check-latest`
57+
* `node-registry-url`
58+
* `node-scope`
59+
* `node-token`
60+
* `node-version`
61+
* `source-map-support-version`

action.yml

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,134 @@ branding:
66
icon: 'box'
77
color: 'blue'
88

9+
# ======================================================================================================================
910
inputs:
11+
12+
coursier-cache-root:
13+
required: false
14+
description: >
15+
Root directory containing build definition sources (build.sbt, build.sc, etc.)
16+
If the sbt or mill build definition files are in a sub-directory, pass the path to this
17+
sub-directory here.
18+
default: '.'
19+
20+
coursier-cache-path:
21+
required: false
22+
description: >
23+
Override for the path of the coursier cache.
24+
By default, the coursier cache is assumed to be in the default OS-dependent location.
25+
Set this input to override that. Note that this action will also set COURSIER_CACHE
26+
if an override is specified, so that you don't have to set it yourself.
27+
default: ''
28+
29+
coursier-cache-job:
30+
required: false
31+
description: >
32+
Job name, to be used in the cache key, so that each job has its own cache.
33+
default: '${{ github.job }}'
34+
35+
coursier-cache-matrix:
36+
required: false
37+
description: >
38+
Matrix values, when using the matrix strategy.
39+
When using build matrices for more than the OS (for Scala versions, JDKs, test suites, …),
40+
pass the matrix values here, with `matrix: -dollar-{{ toJson(matrix) }}`. The matrix instance is hashed,
41+
and added to the cache key, so that each matrix instance has its own cache, and those caches don't
42+
collide.
43+
default: '${{ toJson(matrix) }}'
44+
45+
coursier-cache-extraFiles:
46+
required: false
47+
description: >
48+
Extra files to take into account in the cache key.
49+
By default, sbt build definition files (*.sbt, project/**.{scala,sbt}, project/build.properties) and
50+
mill build definition files (*.sc, ./mill) are hashed to uniquely identify the cached data. Upon
51+
cache restoration, if an exact match is found, the cache is not saved again at the end of the job.
52+
In case of no exact match, it is assumed new files may have been fetched; the previous cache for the
53+
current OS, if any, is restored, but a new cache is persisted with a new key at the end of the job.
54+
To take into account extra files in the cache key, pass via extraFiles either
55+
- a single path as a string
56+
- multiple paths in a JSON array, encoded in a string
57+
Blobs are accepted (processed by [glob-all](https://www.npmjs.com/package/glob-all)).
58+
default: ''
59+
60+
coursier-cache-extraKey:
61+
required: false
62+
description: >
63+
Extra value to be appended to the coursier cache key.
64+
See extraFiles for more details.
65+
default: ''
66+
67+
coursier-cache-extraHashedContent:
68+
required: false
69+
description: >
70+
Extra content to take into account in the cache key.
71+
See extraFiles for more details.
72+
The content of extraHashedContent is taken into account in the hash for the coursier cache key.
73+
default: ''
74+
75+
coursier-cache-extraSbtFiles:
76+
required: false
77+
description: >
78+
Extra sbt files to take into account in the sbt cache key. Same format as extraFiles.
79+
default: ''
80+
81+
coursier-cache-extraSbtKey:
82+
required: false
83+
description: >
84+
Extra value to be appended to the sbt cache key.
85+
See extraFiles for more details.
86+
default: ''
87+
88+
coursier-cache-extraSbtHashedContent:
89+
required: false
90+
description: >
91+
Extra content to take into account in the sbt cache key. Same format as extraHashedContent.
92+
default: ''
93+
94+
coursier-cache-extraMillFiles:
95+
required: false
96+
description: >
97+
Extra mill files to take into account in the mill cache key. Same format as extraFiles.
98+
default: ''
99+
100+
coursier-cache-extraMillKey:
101+
required: false
102+
description: >
103+
Extra value to be appended to the mill cache key.
104+
See extraFiles for more details.
105+
default: ''
106+
107+
coursier-cache-extraMillHashedContent:
108+
required: false
109+
description: >
110+
Extra content to take into account in the mill cache key. Same format as extraHashedContent.
111+
default: ''
112+
113+
coursier-cache-ammoniteScripts:
114+
required: false
115+
description: >
116+
Ammonite scripts to take into account in the Ammonite cache key. Same format as extraFiles.
117+
default: ''
118+
119+
coursier-cache-extraAmmoniteKey:
120+
required: false
121+
description: >
122+
Extra value to be appended to the Ammonite cache key.
123+
See extraFiles for more details.
124+
default: ''
125+
126+
coursier-cache-extraAmmoniteHashedContent:
127+
required: false
128+
description: >
129+
Extra content to take into account in the Ammonite cache key. Same format as extraHashedContent.
130+
default: ''
131+
132+
jabba-version:
133+
description: 'The Jabba version to install.'
134+
required: false
135+
default: '0.11.2'
136+
10137
java-version:
11138
description: 'The Java version to install.'
12139
required: false
@@ -17,6 +144,15 @@ inputs:
17144
required: false
18145
default: 'latest'
19146

147+
node-always-auth:
148+
description: 'Set always-auth in npmrc'
149+
required: false
150+
default: 'false'
151+
152+
node-architecture:
153+
description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.'
154+
required: false
155+
20156
node-cache:
21157
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm'
22158
required: false
@@ -25,8 +161,26 @@ inputs:
25161
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
26162
required: false
27163

164+
node-check-latest:
165+
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
166+
required: false
167+
default: 'false'
168+
169+
node-registry-url:
170+
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN'
171+
required: false
172+
173+
node-scope:
174+
description: 'Optional scope for authenticating against scoped registries'
175+
required: false
176+
177+
node-token:
178+
description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user.
179+
required: false
180+
default: ${{ github.token }}
181+
28182
node-version:
29-
description: 'The Node version to install.'
183+
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0'
30184
required: false
31185
default: '16'
32186

@@ -35,21 +189,29 @@ inputs:
35189
required: false
36190
default: 'latest'
37191

192+
# ======================================================================================================================
38193
runs:
39194
using: 'composite'
40195
steps:
41196

42197
- name: Setup Java and Scala
43198
uses: olafurpg/setup-scala@v13
44199
with:
200+
jabba-version: ${{ inputs.jabba-version }}
45201
java-version: ${{ inputs.java-version }}
46202

47203
- name: Setup Node
48204
uses: actions/setup-node@v2
49205
with:
206+
always-auth: ${{ inputs.node-always-auth }}
207+
architecture: ${{ inputs.node-architecture }}
50208
cache: ${{ inputs.node-cache }}
51209
cache-dependency-path: ${{ inputs.node-cache-dependency-path }}
210+
check-latest: ${{ inputs.node-check-latest }}
52211
node-version: ${{ inputs.node-version }}
212+
registry-url: ${{ inputs.node-registry-url }}
213+
scope: ${{ inputs.node-scope }}
214+
token: ${{ inputs.node-token }}
53215

54216
- name: Setup Scala.JS
55217
uses: japgolly/setup-scalajs@v1
@@ -59,3 +221,20 @@ runs:
59221

60222
- name: Cache sbt
61223
uses: coursier/[email protected]
224+
with:
225+
ammoniteScripts: ${{ inputs.coursier-cache-ammoniteScripts }}
226+
extraAmmoniteHashedContent: ${{ inputs.coursier-cache-extraAmmoniteHashedContent }}
227+
extraAmmoniteKey: ${{ inputs.coursier-cache-extraAmmoniteKey }}
228+
extraFiles: ${{ inputs.coursier-cache-extraFiles }}
229+
extraHashedContent: ${{ inputs.coursier-cache-extraHashedContent }}
230+
extraKey: ${{ inputs.coursier-cache-extraKey }}
231+
extraMillFiles: ${{ inputs.coursier-cache-extraMillFiles }}
232+
extraMillHashedContent: ${{ inputs.coursier-cache-extraMillHashedContent }}
233+
extraMillKey: ${{ inputs.coursier-cache-extraMillKey }}
234+
extraSbtFiles: ${{ inputs.coursier-cache-extraSbtFiles }}
235+
extraSbtHashedContent: ${{ inputs.coursier-cache-extraSbtHashedContent }}
236+
extraSbtKey: ${{ inputs.coursier-cache-extraSbtKey }}
237+
job: ${{ inputs.coursier-cache-job }}
238+
matrix: ${{ inputs.coursier-cache-matrix }}
239+
path: ${{ inputs.coursier-cache-path }}
240+
root: ${{ inputs.coursier-cache-root }}

0 commit comments

Comments
 (0)