Skip to content

Commit 71f5993

Browse files
committed
feat(github-actions): expose more common information in setup-wsl action
This makes the downstream job code much simpler and more readable.
1 parent 7ac5203 commit 71f5993

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

github-actions/setup-wsl/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ outputs:
1515
tmp_dir:
1616
description: WSL unix path pointing to the temporary directory in the host system.
1717
value: ${{steps.wsl_paths.outputs.tmp_dir}}
18+
wsl_root_path:
19+
description: Windows path pointing to the WSL file system root (using a symlink).
20+
value: C:\wsl_root
21+
wsl_root_unc_path:
22+
description: UNC Windows path pointing to the WSL file system root.
23+
value: \\wsl.localhost\Debian
1824

1925
runs:
2026
using: composite
@@ -66,12 +72,19 @@ runs:
6672
shell: powershell
6773
run: Set-NetFirewallProfile -Profile Public -DisabledInterfaceAliases "vEthernet (WSL)"
6874

75+
- name: Create link to WSL drive
76+
shell: powershell
77+
run: New-Item -ItemType SymbolicLink -Path "C:\wsl_root" -Target "\\wsl.localhost\Debian"
78+
6979
- name: Setup nvm
7080
shell: wsl-bash {0}
7181
run: |
7282
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
7383
export NVM_DIR="$HOME/.nvm"
7484
# Note: Specify `--install` due to https://github.com/nvm-sh/nvm/issues/1985.
7585
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --install
86+
7687
- run: nvm install
7788
shell: wsl-bash {0}
89+
- run: npm install -g yarn@1
90+
shell: wsl-bash {0}

0 commit comments

Comments
 (0)