[Tests] fix windows WSL tests

Jordan Harband 2021-11-25 19:35:39 -08:00
parent 89379176ac
commit 275001b066
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 12 additions and 4 deletions

View File

@ -87,6 +87,9 @@ jobs:
wsl_matrix: wsl_matrix:
name: 'WSL nvm install' name: 'WSL nvm install'
defaults:
run:
shell: wsl-bash {0}
runs-on: windows-latest runs-on: windows-latest
env: env:
WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p
@ -99,19 +102,24 @@ jobs:
- Ubuntu-18.04 - Ubuntu-18.04
npm-node-version: npm-node-version:
- '--lts' - '--lts'
- '14'
- '12'
- '11' - '11'
- '10'
method:
- ''
# - 'script' # TODO: uncomment this.
steps: steps:
- uses: Vampire/setup-wsl@v1 - uses: Vampire/setup-wsl@v1
with: with:
distribution: ${{ matrix.wsl-distrib }} distribution: ${{ matrix.wsl-distrib }}
additional-packages: bash git curl ca-certificates additional-packages: bash git curl ca-certificates wget
- name: Retrieve nvm on WSL - name: Retrieve nvm on WSL
shell: wsl-bash {0}
run: | run: |
if [ "${{ matrix.wsl-distrib }}" = "Ubuntu-18.04" ] && [ "${{ matrix.npm-node-version }}" = "--lts" ]; then if [ -z "${{ matrix.method }}" ]; then
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
else else
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash
fi fi
. "$HOME/.nvm/nvm.sh" . "$HOME/.nvm/nvm.sh"
nvm install ${{ matrix.npm-node-version }} nvm install ${{ matrix.npm-node-version }}