2021-01-02 07:03:24 +08:00
|
|
|
name: 'Tests on Windows: `nvm install`'
|
|
|
|
|
|
|
|
on: [pull_request, push]
|
|
|
|
|
|
|
|
env:
|
|
|
|
NVM_INSTALL_GITHUB_REPO: ${{ github.repository }}
|
|
|
|
NVM_INSTALL_VERSION: ${{ github.sha }}
|
|
|
|
|
|
|
|
jobs:
|
2021-04-16 13:34:40 +08:00
|
|
|
msys_fail_install:
|
2021-01-02 07:03:24 +08:00
|
|
|
# Default installation does not work due to npm_config_prefix set to C:\npm\prefix
|
|
|
|
name: 'MSYS fail prefix nvm install'
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Retrieve nvm
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
|
|
|
|
. "$HOME/.nvm/nvm.sh"
|
|
|
|
! nvm install --lts
|
2021-04-16 13:34:40 +08:00
|
|
|
|
|
|
|
msys_matrix:
|
2021-01-02 07:03:24 +08:00
|
|
|
name: 'MSYS nvm install'
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
2021-09-01 06:28:41 +08:00
|
|
|
fail-fast: false
|
2021-01-02 07:03:24 +08:00
|
|
|
matrix:
|
|
|
|
npm-node-version:
|
|
|
|
- '--lts'
|
|
|
|
- '--default 12'
|
|
|
|
- '--no-progress 10'
|
|
|
|
steps:
|
|
|
|
- name: Retrieve nvm
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
unset npm_config_prefix
|
|
|
|
if [ "${{ matrix.npm-node-version }}" = "--lts" ]; then
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
|
|
|
|
else
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
|
|
|
|
fi
|
|
|
|
. "$HOME/.nvm/nvm.sh"
|
|
|
|
nvm install ${{ matrix.npm-node-version }}
|
2021-04-16 13:34:40 +08:00
|
|
|
|
|
|
|
cygwin_matrix:
|
2021-01-02 07:03:24 +08:00
|
|
|
name: 'Cygwin nvm install'
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Install Cygwin
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export SITE='https://mirror.clarkson.edu/cygwin/'
|
|
|
|
export LOCALDIR="$(pwd)"
|
|
|
|
export ROOTDIR="$USERPROFILE\\cygwin"
|
|
|
|
export PACKAGES='bash,git,curl'
|
|
|
|
|
|
|
|
curl -fsSLo setup-x86_64.exe 'https://cygwin.com/setup-x86_64.exe'
|
|
|
|
./setup-x86_64.exe --disable-buggy-antivirus -q -s "$SITE" -l "$LOCALDIR" -R "$ROOTDIR" -P "$PACKAGES"
|
|
|
|
|
|
|
|
cat >~/setup.sh <<EOM
|
|
|
|
unset npm_config_prefix
|
|
|
|
export NVM_INSTALL_GITHUB_REPO="$NVM_INSTALL_GITHUB_REPO"
|
|
|
|
export NVM_INSTALL_VERSION="$NVM_INSTALL_VERSION"
|
|
|
|
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
|
|
|
|
. "$HOME/.nvm/nvm.sh"
|
|
|
|
nvm install --lts
|
|
|
|
|
|
|
|
nvm deactivate
|
|
|
|
rm -rf "$HOME/.nvm/nvm.sh"
|
|
|
|
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
|
|
|
|
. "$HOME/.nvm/nvm.sh"
|
|
|
|
nvm install 9
|
|
|
|
EOM
|
|
|
|
- name: Retrieve nvm
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
cd %USERPROFILE%\cygwin\bin
|
|
|
|
bash.exe "%USERPROFILE%\setup.sh"
|
2021-04-16 13:34:40 +08:00
|
|
|
|
|
|
|
wsl_matrix:
|
2021-01-02 07:03:24 +08:00
|
|
|
name: 'WSL nvm install'
|
|
|
|
runs-on: windows-latest
|
|
|
|
env:
|
|
|
|
WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p
|
|
|
|
strategy:
|
2021-09-01 06:28:41 +08:00
|
|
|
fail-fast: false
|
2021-01-02 07:03:24 +08:00
|
|
|
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 git curl ca-certificates
|
|
|
|
- name: Retrieve nvm on WSL
|
|
|
|
shell: wsl-bash {0}
|
|
|
|
run: |
|
|
|
|
if [ "${{ matrix.wsl-distrib }}" = "Ubuntu-18.04" ] && [ "${{ matrix.npm-node-version }}" = "--lts" ]; then
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash
|
|
|
|
else
|
|
|
|
curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash
|
|
|
|
fi
|
|
|
|
. "$HOME/.nvm/nvm.sh"
|
|
|
|
nvm install ${{ matrix.npm-node-version }}
|
2021-04-16 13:34:40 +08:00
|
|
|
|
|
|
|
nvm_windows:
|
|
|
|
needs: [wsl_matrix, cygwin_matrix, msys_matrix, msys_fail_install]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- run: 'echo tests completed'
|