@@ -7,21 +7,14 @@ Setup WSL
7
7
A GitHub action to install and setup a Linux distribution for the Windows Subsystem for Linux (WSL).
8
8
9
9
Beginning with ` windows-2019 ` virtual environment for GitHub actions, WSLv1 is enabled.
10
+ Beginning with later ` windows-2022 ` virtual environment version for GitHub actions, WSLv2 is also available.
10
11
However, there is no Linux distribution installed by default and there is also no easy shell for
11
12
` run ` steps that executes commands within a WSL distribution.
12
13
13
14
This action provides an easy way to install Linux distributions for WSL, update those to the latest packages and
14
15
install additional packages in them. It also provides a comfortable shell for ` run ` steps that uses the default
15
16
WSL distribution and distribution-specific shells if you set up multiple distributions.
16
17
17
- WSLv2 is not explicitly supported, because as of this writing neither the Windows version running on GitHub hosted
18
- runners supports WSLv2, nor is Hyper-V enabled which is also necessary to enable WSLv2. If you use a self-hosted
19
- runner on a Windows OS that is new enough with enabled Hyper-V and default WSL version set to 2, this action will
20
- probably run just fine, but this setup is untested and not explicitly supported. If you want to provide a self-hosted
21
- runner with a sufficient setup for this action to use or need changes for supporting WSLv2 I will happily accept this.
22
- With a proper test environment (self-hosted runner) that will stay available, I would also add proper official support
23
- where you can select the WSL version in your workflow files.
24
-
25
18
Thanks to the provided [ typings] ( action-types.yml ) , it is possible to use this action in a type-safe way using
26
19
https://github.com/typesafegithub/github-workflows-kt which allows writing workflow files using a type-safe Kotlin DSL.
27
20
@@ -58,7 +51,7 @@ To use this action with all inputs set to their default value, just use its name
58
51
_ ** Example:** _
59
52
60
53
``` yaml
61
- - uses : Vampire/setup-wsl@v3
54
+ - uses : Vampire/setup-wsl@v4
62
55
` ` `
63
56
64
57
This will first check whether the distribution is installed already. If not, it will be installed and also
@@ -121,7 +114,7 @@ defaults:
121
114
shell: wsl-bash {0}
122
115
123
116
steps:
124
- - uses: Vampire/setup-wsl@v3
117
+ - uses: Vampire/setup-wsl@v4
125
118
126
119
- run: |
127
120
npm ci
@@ -163,7 +156,7 @@ The values currently supported by this action are:
163
156
164
157
_**Example:**_
165
158
` ` ` yaml
166
- - uses: Vampire/setup-wsl@v3
159
+ - uses: Vampire/setup-wsl@v4
167
160
with:
168
161
distribution: Ubuntu-18.04
169
162
` ` `
@@ -180,7 +173,7 @@ space of the repository. Refer to [`actions/cache` documentation][actions/cache
180
173
181
174
_**Example:**_
182
175
` ` ` yaml
183
- - uses: Vampire/setup-wsl@v3
176
+ - uses: Vampire/setup-wsl@v4
184
177
with:
185
178
use-cache: 'false'
186
179
` ` `
@@ -201,7 +194,7 @@ its contents in your configured value.
201
194
202
195
_**Example:**_
203
196
` ` ` yaml
204
- - uses: Vampire/setup-wsl@v3
197
+ - uses: Vampire/setup-wsl@v4
205
198
with:
206
199
wsl-conf: |
207
200
[automount]
@@ -220,7 +213,7 @@ This can also be used if the distribution is installed already.
220
213
221
214
_**Example:**_
222
215
` ` ` yaml
223
- - uses: Vampire/setup-wsl@v3
216
+ - uses: Vampire/setup-wsl@v4
224
217
with:
225
218
set-as-default: 'false'
226
219
` ` `
@@ -234,7 +227,7 @@ This can also be used if the distribution is installed already.
234
227
235
228
_**Example:**_
236
229
` ` ` yaml
237
- - uses: Vampire/setup-wsl@v3
230
+ - uses: Vampire/setup-wsl@v4
238
231
with:
239
232
update: 'true'
240
233
` ` `
@@ -248,7 +241,7 @@ This can also be used if the distribution is installed already.
248
241
249
242
_**Example:**_
250
243
` ` ` yaml
251
- - uses: Vampire/setup-wsl@v3
244
+ - uses: Vampire/setup-wsl@v4
252
245
with:
253
246
additional-packages:
254
247
dos2unix
@@ -266,7 +259,7 @@ it is automatically added.
266
259
267
260
_**Example:**_
268
261
` ` ` yaml
269
- - uses: Vampire/setup-wsl@v3
262
+ - uses: Vampire/setup-wsl@v4
270
263
with:
271
264
wsl-shell-user: test
272
265
` ` `
@@ -297,7 +290,7 @@ scripts, the [`wsl-shell-wrapper-path` output](#wsl-shell-wrapper-path) and
297
290
298
291
_**Examples:**_
299
292
` ` ` yaml
300
- - uses: Vampire/setup-wsl@v3
293
+ - uses: Vampire/setup-wsl@v4
301
294
with:
302
295
wsl-shell-command: ash -eu
303
296
@@ -308,21 +301,21 @@ _**Examples:**_
308
301
run: |
309
302
useradd -m -p 4qBD5NWD3IkbU test
310
303
311
- - uses: Vampire/setup-wsl@v3
304
+ - uses: Vampire/setup-wsl@v4
312
305
with:
313
306
wsl-shell-command: bash -c "sudo -u test bash --noprofile --norc -euo pipefail "\
314
307
315
308
- shell: wsl-bash {0}
316
309
run: id
317
310
318
- - uses: Vampire/setup-wsl@v3
311
+ - uses: Vampire/setup-wsl@v4
319
312
with:
320
313
wsl-shell-command: bash -c "sudo -u test bash --noprofile --norc -euo pipefail '{0}'"
321
314
322
315
- shell: wsl-bash {0}
323
316
run: id
324
317
325
- - uses: Vampire/setup-wsl@v3
318
+ - uses: Vampire/setup-wsl@v4
326
319
with:
327
320
wsl-shell-command: bash -c "cd && bash --noprofile --norc -euo pipefail '{0}'"
328
321
@@ -333,6 +326,26 @@ _**Examples:**_
333
326
run: DEL /F "${{ steps.execute_action.outputs.wsl-shell-wrapper-path }}"
334
327
` ` `
335
328
329
+ # ### wsl-version
330
+
331
+ The WSL version that should be used. This can be set to any positive integer. Using an untested one might
332
+ work or break, so issues a warning for the action run. Currently, WSLv1 and WSLv2 are tested and do not
333
+ issue a warning. If a new WSL version is available and your workflow works with it, please report an issue
334
+ so that proper tests can be added and the warning for that version removed.
335
+ Default is '1' if running on 'windows-2019' virtual environment as this is not yet supporting WSLv2.
336
+ Default is '2' if not running on 'windows-2019' virtual environment.
337
+
338
+ **Default value:**
339
+ * `1` if running on 'windows-2019' virtual environment as this is not yet supporting WSLv2
340
+ * `2` if not running on 'windows-2019' virtual environment
341
+
342
+ _**Example:**_
343
+ ` ` ` yaml
344
+ - uses: Vampire/setup-wsl@v3
345
+ with:
346
+ wsl-version: 1
347
+ ` ` `
348
+
336
349
337
350
338
351
# ## Outputs
0 commit comments