-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it work on Windows with WSL, MSYS, Cygwin
- Loading branch information
1 parent
f3fa157
commit 6c5456c
Showing
8 changed files
with
294 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: 'Tests on Windows: `nvm install`' | ||
|
||
on: [pull_request, push] | ||
|
||
env: | ||
NVM_INSTALL_GITHUB_USER: ${{ github.repository }} | ||
NVM_INSTALL_VERSION: ${{ github.sha }} | ||
|
||
jobs: | ||
node: | ||
name: 'MSYS fail prefix nvm install' | ||
runs-on: windows-latest | ||
steps: | ||
- name: Retrieve nvm | ||
shell: bash | ||
run: | | ||
curl -sSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_USER}/${NVM_INSTALL_VERSION}/nvm.sh" | METHOD=script bash | ||
. "$HOME/.nvm/nvm.sh" | ||
! nvm install --lts | ||
nodes: | ||
name: 'MSYS nvm install' | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
npm-node-version: | ||
- '--lts' | ||
- '--default 12' | ||
- '--no-progress 10' | ||
|
||
steps: | ||
- name: Retrieve nvm | ||
shell: bash | ||
run: | | ||
unset npm_config_prefix | ||
curl -sSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_USER}/${NVM_INSTALL_VERSION}/nvm.sh" | METHOD=script bash | ||
. "$HOME/.nvm/nvm.sh" | ||
nvm install ${{ matrix.npm-node-version }} | ||
wsl_nodes: | ||
name: 'WSL nvm install' | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
wsl-distrib: | ||
- Debian | ||
- Alpine | ||
- Ubuntu-18.04 | ||
npm-node-version: | ||
- '--lts' | ||
- '11' | ||
steps: | ||
- uses: Vampire/setup-wsl@v1 | ||
with: | ||
distribution: ${{ matrix.wsl-distrib }} | ||
additional-packages: bash curl ca-certificates | ||
wsl-shell-command: WSLENV=NVM_INSTALL_GITHUB_USER:NVM_INSTALL_VERSION/p bash -c "sudo -u test bash --noprofile --norc -euo pipefail " | ||
- name: Retrieve nvm on WSL | ||
shell: wsl-bash {0} | ||
run: | | ||
env | sort | ||
export NVM_INSTALL_GITHUB_USER=${{ github.repository }} | ||
export NVM_INSTALL_VERSION=${{ github.sha }} | ||
curl -sSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_USER}/${NVM_INSTALL_VERSION}/nvm.sh" | METHOD=script bash | ||
. "$HOME/.nvm/nvm.sh" | ||
nvm install ${{ matrix.npm-node-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.