mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-04 17:02:48 +08:00
[actions] migrate Travis CI tests to GitHub Actions
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
Tests: `nvm install-latest-npm` / matrix (push) Has been cancelled
Tests: `nvm install-latest-npm` / nvm install-latest-npm (push) Has been cancelled
Tests: linting / dockerfile_lint (push) Has been cancelled
Tests: linting / doctoc (push) Has been cancelled
Tests: linting / test_naming (push) Has been cancelled
Tests: linting / eclint (push) Has been cancelled
Tests: nvm install with set -e / matrix (push) Has been cancelled
Tests: nvm install with set -e / test (push) Has been cancelled
Tests: nvm install with set -e / finisher (push) Has been cancelled
Tests: release process / release (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (bash_completion, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (install.sh, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm-exec, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, dash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, ksh) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, sh) (push) Has been cancelled
Tests: shellcheck / shellcheck (push) Has been cancelled
Tests: fast / all fast tests (push) Has been cancelled
Tests: installation_node / installation_node (bash) (push) Has been cancelled
Tests: installation_node / installation_node (bash, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (dash) (push) Has been cancelled
Tests: installation_node / installation_node (dash, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (sh) (push) Has been cancelled
Tests: installation_node / installation_node (sh, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (zsh) (push) Has been cancelled
Tests: installation_node / installation_node (zsh, without curl) (push) Has been cancelled
Tests: installation_node / all installation_node tests (push) Has been cancelled
Tests: fast / fast (bash) (push) Has been cancelled
Tests: fast / fast (dash) (push) Has been cancelled
Tests: fast / fast (sh) (push) Has been cancelled
Tests: fast / fast (zsh) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (bash) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (dash) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (sh) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (zsh) (push) Has been cancelled
Tests: installation_iojs / all installation_iojs tests (push) Has been cancelled
Tests: xenial / xenial (bash) (push) Has been cancelled
Tests: xenial / xenial (dash) (push) Has been cancelled
Tests: xenial / xenial (sh) (push) Has been cancelled
Tests: xenial / xenial (zsh) (push) Has been cancelled
Tests: xenial / all xenial tests (push) Has been cancelled
urchin tests / tests (bash, install_script) (push) Has been cancelled
urchin tests / tests (bash, installation_iojs) (push) Has been cancelled
urchin tests / tests (bash, slow) (push) Has been cancelled
urchin tests / tests (bash, sourcing) (push) Has been cancelled
urchin tests / tests (dash, installation_iojs) (push) Has been cancelled
urchin tests / tests (dash, slow) (push) Has been cancelled
urchin tests / tests (dash, sourcing) (push) Has been cancelled
urchin tests / tests (sh, installation_iojs) (push) Has been cancelled
urchin tests / tests (sh, slow) (push) Has been cancelled
urchin tests / tests (sh, sourcing) (push) Has been cancelled
urchin tests / tests (zsh, installation_iojs) (push) Has been cancelled
urchin tests / tests (zsh, slow) (push) Has been cancelled
urchin tests / tests (zsh, sourcing) (push) Has been cancelled
urchin tests / all test suites, all shells (push) Has been cancelled
update readme TOC / update readme TOC (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--lts) (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS fail prefix nvm install (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--default 12) (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--no-progress 10) (push) Has been cancelled
Tests on Windows: `nvm install` / Cygwin nvm install (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / tests, on windows (push) Has been cancelled
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
Tests: `nvm install-latest-npm` / matrix (push) Has been cancelled
Tests: `nvm install-latest-npm` / nvm install-latest-npm (push) Has been cancelled
Tests: linting / dockerfile_lint (push) Has been cancelled
Tests: linting / doctoc (push) Has been cancelled
Tests: linting / test_naming (push) Has been cancelled
Tests: linting / eclint (push) Has been cancelled
Tests: nvm install with set -e / matrix (push) Has been cancelled
Tests: nvm install with set -e / test (push) Has been cancelled
Tests: nvm install with set -e / finisher (push) Has been cancelled
Tests: release process / release (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (bash_completion, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (install.sh, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm-exec, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, bash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, dash) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, ksh) (push) Has been cancelled
Tests: shellcheck / shellcheck_matrix (nvm.sh, sh) (push) Has been cancelled
Tests: shellcheck / shellcheck (push) Has been cancelled
Tests: fast / all fast tests (push) Has been cancelled
Tests: installation_node / installation_node (bash) (push) Has been cancelled
Tests: installation_node / installation_node (bash, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (dash) (push) Has been cancelled
Tests: installation_node / installation_node (dash, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (sh) (push) Has been cancelled
Tests: installation_node / installation_node (sh, without curl) (push) Has been cancelled
Tests: installation_node / installation_node (zsh) (push) Has been cancelled
Tests: installation_node / installation_node (zsh, without curl) (push) Has been cancelled
Tests: installation_node / all installation_node tests (push) Has been cancelled
Tests: fast / fast (bash) (push) Has been cancelled
Tests: fast / fast (dash) (push) Has been cancelled
Tests: fast / fast (sh) (push) Has been cancelled
Tests: fast / fast (zsh) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (bash) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (dash) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (sh) (push) Has been cancelled
Tests: installation_iojs / installation_iojs without curl (zsh) (push) Has been cancelled
Tests: installation_iojs / all installation_iojs tests (push) Has been cancelled
Tests: xenial / xenial (bash) (push) Has been cancelled
Tests: xenial / xenial (dash) (push) Has been cancelled
Tests: xenial / xenial (sh) (push) Has been cancelled
Tests: xenial / xenial (zsh) (push) Has been cancelled
Tests: xenial / all xenial tests (push) Has been cancelled
urchin tests / tests (bash, install_script) (push) Has been cancelled
urchin tests / tests (bash, installation_iojs) (push) Has been cancelled
urchin tests / tests (bash, slow) (push) Has been cancelled
urchin tests / tests (bash, sourcing) (push) Has been cancelled
urchin tests / tests (dash, installation_iojs) (push) Has been cancelled
urchin tests / tests (dash, slow) (push) Has been cancelled
urchin tests / tests (dash, sourcing) (push) Has been cancelled
urchin tests / tests (sh, installation_iojs) (push) Has been cancelled
urchin tests / tests (sh, slow) (push) Has been cancelled
urchin tests / tests (sh, sourcing) (push) Has been cancelled
urchin tests / tests (zsh, installation_iojs) (push) Has been cancelled
urchin tests / tests (zsh, slow) (push) Has been cancelled
urchin tests / tests (zsh, sourcing) (push) Has been cancelled
urchin tests / all test suites, all shells (push) Has been cancelled
update readme TOC / update readme TOC (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--lts) (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS fail prefix nvm install (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--default 12) (push) Has been cancelled
Tests on Windows: `nvm install` / MSYS nvm install (--no-progress 10) (push) Has been cancelled
Tests on Windows: `nvm install` / Cygwin nvm install (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-18.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-20.04) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine) (push) Has been cancelled
Tests on Windows: `nvm install` / tests, on windows (push) Has been cancelled
Add new workflow for tests that were only running on Travis CI: - fast test suite (sh, bash, dash, zsh) - installation_iojs without curl (sh, bash, dash, zsh) - installation_node with and without curl (sh, bash, dash, zsh) - xenial test suite (sh, bash, dash, zsh) The installation_node and xenial tests run on ubuntu-20.04 to match the Travis xenial environment as closely as possible.
This commit is contained in:
95
.github/workflows/tests-fast.yml
vendored
Normal file
95
.github/workflows/tests-fast.yml
vendored
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
name: 'Tests: fast'
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fast:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
name: 'fast (${{ matrix.shell }})'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: 'script -q -e -c "${{ matrix.shell }} {0}"'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
shell:
|
||||||
|
- sh
|
||||||
|
- bash
|
||||||
|
- dash
|
||||||
|
- zsh
|
||||||
|
# - ksh
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@v2
|
||||||
|
with:
|
||||||
|
allowed-endpoints:
|
||||||
|
github.com:443
|
||||||
|
registry.npmjs.org:443
|
||||||
|
raw.githubusercontent.com:443
|
||||||
|
nodejs.org:443
|
||||||
|
iojs.org:443
|
||||||
|
unofficial-builds.nodejs.org:443
|
||||||
|
azure.archive.ubuntu.com:80
|
||||||
|
packages.microsoft.com:443
|
||||||
|
registry-1.docker.io:443
|
||||||
|
auth.docker.io:443
|
||||||
|
production.cloudflare.docker.com:443
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install zsh and additional shells
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y zsh
|
||||||
|
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then
|
||||||
|
sudo apt-get install -y ${{ matrix.shell }}
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
|
||||||
|
- run: curl --version
|
||||||
|
- run: wget --version
|
||||||
|
- uses: ljharb/actions/node/install@main
|
||||||
|
name: 'npm install && version checks'
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
skip-ls-check: true
|
||||||
|
- run: npm ls urchin
|
||||||
|
- run: npx which urchin
|
||||||
|
- run: env
|
||||||
|
- name: Hide system node
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node ]; then sudo mv /usr/local/bin/node /usr/local/bin/node.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npm ]; then sudo mv /usr/local/bin/npm /usr/local/bin/npm.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npx ]; then sudo mv /usr/local/bin/npx /usr/local/bin/npx.bak; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Run fast tests
|
||||||
|
run: |
|
||||||
|
URCHIN_PATH="$(npx which urchin)"
|
||||||
|
unset NVM_CD_FLAGS NVM_BIN NVM_INC
|
||||||
|
export NVM_DIR="${{ github.workspace }}"
|
||||||
|
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
|
||||||
|
make TERM=xterm-256color TEST_SUITE="fast" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
|
||||||
|
- name: Restore system node
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node.bak ]; then sudo mv /usr/local/bin/node.bak /usr/local/bin/node; fi
|
||||||
|
if [ -f /usr/local/bin/npm.bak ]; then sudo mv /usr/local/bin/npm.bak /usr/local/bin/npm; fi
|
||||||
|
if [ -f /usr/local/bin/npx.bak ]; then sudo mv /usr/local/bin/npx.bak /usr/local/bin/npx; fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
all:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
|
name: 'all fast tests'
|
||||||
|
needs: [fast]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: true
|
||||||
99
.github/workflows/tests-installation-iojs.yml
vendored
Normal file
99
.github/workflows/tests-installation-iojs.yml
vendored
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
name: 'Tests: installation_iojs'
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
installation_iojs_without_curl:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
name: 'installation_iojs without curl (${{ matrix.shell }})'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: 'script -q -e -c "${{ matrix.shell }} {0}"'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
shell:
|
||||||
|
- sh
|
||||||
|
- bash
|
||||||
|
- dash
|
||||||
|
- zsh
|
||||||
|
# - ksh
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@v2
|
||||||
|
with:
|
||||||
|
allowed-endpoints:
|
||||||
|
github.com:443
|
||||||
|
registry.npmjs.org:443
|
||||||
|
raw.githubusercontent.com:443
|
||||||
|
nodejs.org:443
|
||||||
|
iojs.org:443
|
||||||
|
azure.archive.ubuntu.com:80
|
||||||
|
packages.microsoft.com:443
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install zsh and additional shells
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y zsh
|
||||||
|
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then
|
||||||
|
sudo apt-get install -y ${{ matrix.shell }}
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- run: sudo ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
|
||||||
|
- run: wget --version
|
||||||
|
- uses: ljharb/actions/node/install@main
|
||||||
|
name: 'npm install && version checks'
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
skip-ls-check: true
|
||||||
|
- run: npm ls urchin
|
||||||
|
- run: npx which urchin
|
||||||
|
- name: Remove curl
|
||||||
|
run: sudo apt-get remove curl -y
|
||||||
|
shell: bash
|
||||||
|
- run: '! command -v curl'
|
||||||
|
shell: bash
|
||||||
|
- run: env
|
||||||
|
- name: Hide system node
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node ]; then sudo mv /usr/local/bin/node /usr/local/bin/node.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npm ]; then sudo mv /usr/local/bin/npm /usr/local/bin/npm.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npx ]; then sudo mv /usr/local/bin/npx /usr/local/bin/npx.bak; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Run installation_iojs tests
|
||||||
|
run: |
|
||||||
|
URCHIN_PATH="$(npx which urchin)"
|
||||||
|
unset NVM_CD_FLAGS NVM_BIN NVM_INC
|
||||||
|
export NVM_DIR="${{ github.workspace }}"
|
||||||
|
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
|
||||||
|
make TERM=xterm-256color TEST_SUITE="installation_iojs" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
|
||||||
|
- name: Restore system node
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node.bak ]; then sudo mv /usr/local/bin/node.bak /usr/local/bin/node; fi
|
||||||
|
if [ -f /usr/local/bin/npm.bak ]; then sudo mv /usr/local/bin/npm.bak /usr/local/bin/npm; fi
|
||||||
|
if [ -f /usr/local/bin/npx.bak ]; then sudo mv /usr/local/bin/npx.bak /usr/local/bin/npx; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Restore curl
|
||||||
|
if: always()
|
||||||
|
run: sudo apt-get install curl -y
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
all:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
|
name: 'all installation_iojs tests'
|
||||||
|
needs: [installation_iojs_without_curl]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: true
|
||||||
116
.github/workflows/tests-installation-node.yml
vendored
Normal file
116
.github/workflows/tests-installation-node.yml
vendored
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
name: 'Tests: installation_node'
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
installation_node:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
name: "installation_node (${{ matrix.shell }}${{ matrix.without_curl && ', without curl' || '' }})"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:18.04
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: 'script -q -e -c "${{ matrix.shell }} {0}"'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
shell:
|
||||||
|
- sh
|
||||||
|
- bash
|
||||||
|
- dash
|
||||||
|
- zsh
|
||||||
|
# - ksh
|
||||||
|
without_curl:
|
||||||
|
- false
|
||||||
|
- true
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install base dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y git curl wget make bsdutils build-essential python
|
||||||
|
shell: bash
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@v1.5.0
|
||||||
|
with:
|
||||||
|
allowed-endpoints:
|
||||||
|
github.com:443
|
||||||
|
registry.npmjs.org:443
|
||||||
|
raw.githubusercontent.com:443
|
||||||
|
nodejs.org:443
|
||||||
|
iojs.org:443
|
||||||
|
archive.ubuntu.com:80
|
||||||
|
security.ubuntu.com:80
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install zsh and additional shells
|
||||||
|
run: |
|
||||||
|
apt-get install -y zsh
|
||||||
|
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then
|
||||||
|
apt-get install -y ${{ matrix.shell }}
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- run: ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
|
||||||
|
- run: curl --version
|
||||||
|
if: ${{ !matrix.without_curl }}
|
||||||
|
- run: wget --version
|
||||||
|
- uses: ljharb/actions/node/install@main
|
||||||
|
name: 'npm install && version checks'
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
skip-ls-check: true
|
||||||
|
- run: npm ls urchin
|
||||||
|
- run: npx which urchin
|
||||||
|
- name: Remove curl
|
||||||
|
if: ${{ matrix.without_curl }}
|
||||||
|
run: apt-get remove curl -y
|
||||||
|
shell: bash
|
||||||
|
- name: Verify curl removed
|
||||||
|
if: ${{ matrix.without_curl }}
|
||||||
|
run: '! command -v curl'
|
||||||
|
shell: bash
|
||||||
|
- run: env
|
||||||
|
- name: Hide system node
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node ]; then mv /usr/local/bin/node /usr/local/bin/node.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npm ]; then mv /usr/local/bin/npm /usr/local/bin/npm.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npx ]; then mv /usr/local/bin/npx /usr/local/bin/npx.bak; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Run installation_node tests
|
||||||
|
run: |
|
||||||
|
URCHIN_PATH="$(npx which urchin)"
|
||||||
|
unset NVM_CD_FLAGS NVM_BIN NVM_INC
|
||||||
|
export NVM_DIR="${{ github.workspace }}"
|
||||||
|
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
|
||||||
|
make TERM=xterm-256color TEST_SUITE="installation_node" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
|
||||||
|
- name: Restore system node
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node.bak ]; then mv /usr/local/bin/node.bak /usr/local/bin/node; fi
|
||||||
|
if [ -f /usr/local/bin/npm.bak ]; then mv /usr/local/bin/npm.bak /usr/local/bin/npm; fi
|
||||||
|
if [ -f /usr/local/bin/npx.bak ]; then mv /usr/local/bin/npx.bak /usr/local/bin/npx; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Restore curl
|
||||||
|
if: ${{ always() && matrix.without_curl }}
|
||||||
|
run: apt-get install curl -y
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
all:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
|
name: 'all installation_node tests'
|
||||||
|
needs: [installation_node]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: true
|
||||||
100
.github/workflows/tests-xenial.yml
vendored
Normal file
100
.github/workflows/tests-xenial.yml
vendored
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
name: 'Tests: xenial'
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
xenial:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
name: 'xenial (${{ matrix.shell }})'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:18.04
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: 'script -q -e -c "${{ matrix.shell }} {0}"'
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
shell:
|
||||||
|
- sh
|
||||||
|
- bash
|
||||||
|
- dash
|
||||||
|
- zsh
|
||||||
|
# - ksh
|
||||||
|
|
||||||
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install base dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y git curl wget make bsdutils build-essential python
|
||||||
|
shell: bash
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@v1.5.0
|
||||||
|
with:
|
||||||
|
allowed-endpoints:
|
||||||
|
github.com:443
|
||||||
|
registry.npmjs.org:443
|
||||||
|
raw.githubusercontent.com:443
|
||||||
|
nodejs.org:443
|
||||||
|
iojs.org:443
|
||||||
|
archive.ubuntu.com:80
|
||||||
|
security.ubuntu.com:80
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install zsh and additional shells
|
||||||
|
run: |
|
||||||
|
apt-get install -y zsh
|
||||||
|
if [ "${{ matrix.shell }}" != "sh" ] && [ "${{ matrix.shell }}" != "bash" ] && [ "${{ matrix.shell }}" != "zsh" ]; then
|
||||||
|
apt-get install -y ${{ matrix.shell }}
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
- run: ${{ matrix.shell }} --version 2> /dev/null || dpkg -s ${{ matrix.shell }} 2> /dev/null || which ${{ matrix.shell }}
|
||||||
|
- run: curl --version
|
||||||
|
- run: wget --version
|
||||||
|
- uses: ljharb/actions/node/install@main
|
||||||
|
name: 'npm install && version checks'
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
skip-ls-check: true
|
||||||
|
- run: npm ls urchin
|
||||||
|
- run: npx which urchin
|
||||||
|
- run: env
|
||||||
|
- name: Hide system node
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node ]; then mv /usr/local/bin/node /usr/local/bin/node.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npm ]; then mv /usr/local/bin/npm /usr/local/bin/npm.bak; fi
|
||||||
|
if [ -f /usr/local/bin/npx ]; then mv /usr/local/bin/npx /usr/local/bin/npx.bak; fi
|
||||||
|
shell: bash
|
||||||
|
- name: Run xenial tests
|
||||||
|
run: |
|
||||||
|
URCHIN_PATH="$(npx which urchin)"
|
||||||
|
unset NVM_CD_FLAGS NVM_BIN NVM_INC
|
||||||
|
export NVM_DIR="${{ github.workspace }}"
|
||||||
|
export PATH="$(echo "$PATH" | tr ':' '\n' | grep -v '\.nvm' | grep -v 'toolcache' | tr '\n' ':')"
|
||||||
|
make TERM=xterm-256color TEST_SUITE="xenial" SHELL="${{ matrix.shell }}" URCHIN="$URCHIN_PATH" test-${{ matrix.shell }}
|
||||||
|
- name: Restore system node
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f /usr/local/bin/node.bak ]; then mv /usr/local/bin/node.bak /usr/local/bin/node; fi
|
||||||
|
if [ -f /usr/local/bin/npm.bak ]; then mv /usr/local/bin/npm.bak /usr/local/bin/npm; fi
|
||||||
|
if [ -f /usr/local/bin/npx.bak ]; then mv /usr/local/bin/npx.bak /usr/local/bin/npx; fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
all:
|
||||||
|
permissions:
|
||||||
|
contents: none
|
||||||
|
name: 'all xenial tests'
|
||||||
|
needs: [xenial]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: true
|
||||||
94
.travis.yml
94
.travis.yml
@@ -1,94 +0,0 @@
|
|||||||
language: generic
|
|
||||||
dist: focal
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- zsh
|
|
||||||
# - ksh
|
|
||||||
# - gcc-4.8
|
|
||||||
# - g++-4.8
|
|
||||||
|
|
||||||
# https://gist.github.com/iedemam/9830045
|
|
||||||
git:
|
|
||||||
submodules: false
|
|
||||||
|
|
||||||
cache:
|
|
||||||
ccache: true
|
|
||||||
directories:
|
|
||||||
- $TRAVIS_BUILD_DIR/.cache
|
|
||||||
- $TRAVIS_BUILD_DIR/node_modules
|
|
||||||
before_install:
|
|
||||||
- sudo sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf
|
|
||||||
- sudo update-ca-certificates -f
|
|
||||||
|
|
||||||
# https://gist.github.com/iedemam/9830045
|
|
||||||
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
|
|
||||||
- $SHELL --version 2> /dev/null || dpkg -s $SHELL 2> /dev/null || which $SHELL
|
|
||||||
- curl --version
|
|
||||||
- wget --version
|
|
||||||
- bash --version | head
|
|
||||||
- zsh --version
|
|
||||||
- dpkg -s dash | grep ^Version | awk '{print $2}'
|
|
||||||
# install python
|
|
||||||
- pyenv local 2.7.18 || pyenv install 2.7.18
|
|
||||||
- pyenv local 2.7.18 || echo 'pyenv failed'
|
|
||||||
- python -V
|
|
||||||
install:
|
|
||||||
- if [ -z "${SHELLCHECK-}" ]; then nvm install 16 && nvm unalias default && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
|
|
||||||
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
|
|
||||||
script:
|
|
||||||
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ] || [ "${TEST_SUITE}" = 'xenial' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi
|
|
||||||
before_cache:
|
|
||||||
- if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- env: SHELL=bash TEST_SUITE=installation_node
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=bash TEST_SUITE=installation_node WITHOUT_CURL=1
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=sh TEST_SUITE=installation_node
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=sh TEST_SUITE=installation_node WITHOUT_CURL=1
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=dash TEST_SUITE=installation_node
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=dash TEST_SUITE=installation_node WITHOUT_CURL=1
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=zsh TEST_SUITE=installation_node
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=zsh TEST_SUITE=installation_node WITHOUT_CURL=1
|
|
||||||
dist: xenial
|
|
||||||
#- env: SHELL=ksh TEST_SUITE=installation_node
|
|
||||||
# dist: xenial
|
|
||||||
#- env: SHELL=ksh TEST_SUITE=installation_node WITHOUT_CURL=1
|
|
||||||
# dist: xenial
|
|
||||||
- env: SHELL=bash TEST_SUITE=xenial
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=sh TEST_SUITE=xenial
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=dash TEST_SUITE=xenial
|
|
||||||
dist: xenial
|
|
||||||
- env: SHELL=zsh TEST_SUITE=xenial
|
|
||||||
dist: xenial
|
|
||||||
#- env: SHELL=ksh TEST_SUITE=xenial
|
|
||||||
# dist: xenial
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- CXX=g++
|
|
||||||
- CC=gcc
|
|
||||||
- PATH="$(echo $PATH | sed 's/::/:/')"
|
|
||||||
- PATH="/usr/lib/ccache/:$PATH"
|
|
||||||
- NVM_DIR="${TRAVIS_BUILD_DIR}"
|
|
||||||
matrix:
|
|
||||||
- SHELL=sh TEST_SUITE=fast
|
|
||||||
- SHELL=dash TEST_SUITE=fast
|
|
||||||
- SHELL=bash TEST_SUITE=fast
|
|
||||||
- SHELL=zsh TEST_SUITE=fast
|
|
||||||
# - SHELL=ksh TEST_SUITE=fast
|
|
||||||
- SHELL=sh TEST_SUITE=installation_iojs WITHOUT_CURL=1
|
|
||||||
- SHELL=dash TEST_SUITE=installation_iojs WITHOUT_CURL=1
|
|
||||||
- SHELL=bash TEST_SUITE=installation_iojs WITHOUT_CURL=1
|
|
||||||
- SHELL=zsh TEST_SUITE=installation_iojs WITHOUT_CURL=1
|
|
||||||
# - SHELL=ksh TEST_SUITE=installation_iojs WITHOUT_CURL=1
|
|
||||||
16
nvm.sh
16
nvm.sh
@@ -2788,12 +2788,16 @@ nvm_die_on_prefix() {
|
|||||||
# npm first looks at $PREFIX (case-sensitive)
|
# npm first looks at $PREFIX (case-sensitive)
|
||||||
# we do not bother to test the value here; if this env var is set, unset it to continue.
|
# we do not bother to test the value here; if this env var is set, unset it to continue.
|
||||||
# however, `npm exec` in npm v7.2+ sets $PREFIX; if set, inherit it
|
# however, `npm exec` in npm v7.2+ sets $PREFIX; if set, inherit it
|
||||||
if [ -n "${PREFIX-}" ] && [ "$(nvm_version_path "$(node -v)")" != "${PREFIX}" ]; then
|
if [ -n "${PREFIX-}" ]; then
|
||||||
|
local NVM_NODE_VERSION
|
||||||
|
NVM_NODE_VERSION="$(node -v 2>/dev/null)"
|
||||||
|
if [ -z "${NVM_NODE_VERSION}" ] || [ "$(nvm_version_path "${NVM_NODE_VERSION}" 2>/dev/null)" != "${PREFIX}" ]; then
|
||||||
nvm deactivate >/dev/null 2>&1
|
nvm deactivate >/dev/null 2>&1
|
||||||
nvm_err "nvm is not compatible with the \"PREFIX\" environment variable: currently set to \"${PREFIX}\""
|
nvm_err "nvm is not compatible with the \"PREFIX\" environment variable: currently set to \"${PREFIX}\""
|
||||||
nvm_err 'Run `unset PREFIX` to unset it.'
|
nvm_err 'Run `unset PREFIX` to unset it.'
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
local NVM_OS
|
local NVM_OS
|
||||||
NVM_OS="$(nvm_get_os)"
|
NVM_OS="$(nvm_get_os)"
|
||||||
@@ -4624,24 +4628,24 @@ nvm_auto() {
|
|||||||
VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
|
VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
|
||||||
if [ -n "${VERSION}" ]; then
|
if [ -n "${VERSION}" ]; then
|
||||||
if [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
|
if [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
|
||||||
nvm use --silent "${VERSION}" >/dev/null
|
nvm use --silent "${VERSION}" >/dev/null || :
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
elif nvm_rc_version >/dev/null 2>&1; then
|
elif nvm_rc_version >/dev/null 2>&1; then
|
||||||
nvm use --silent >/dev/null
|
nvm use --silent >/dev/null || :
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
nvm use --silent "${NVM_CURRENT}" >/dev/null
|
nvm use --silent "${NVM_CURRENT}" >/dev/null || :
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
install)
|
install)
|
||||||
local VERSION
|
local VERSION
|
||||||
VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
|
VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
|
||||||
if [ -n "${VERSION}" ] && [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
|
if [ -n "${VERSION}" ] && [ "_${VERSION}" != '_N/A' ] && nvm_is_valid_version "${VERSION}"; then
|
||||||
nvm install "${VERSION}" >/dev/null
|
nvm install "${VERSION}" >/dev/null || :
|
||||||
elif nvm_rc_version >/dev/null 2>&1; then
|
elif nvm_rc_version >/dev/null 2>&1; then
|
||||||
nvm install >/dev/null
|
nvm install >/dev/null || :
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
die () { echo "$@" ; cleanup ; exit 1; }
|
die () { echo "$@" ; cleanup ; exit 1; }
|
||||||
|
|
||||||
|
strip_colors() {
|
||||||
|
command sed $'s/\x1b\\[[0-9;]*m//g'
|
||||||
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
unset -f nvm_download nvm_ls_remote nvm_ls_remote_iojs
|
unset -f nvm_download nvm_ls_remote nvm_ls_remote_iojs
|
||||||
if [ -n "${TEMP_NVM_COLORS-}" ]; then
|
if [ -n "${TEMP_NVM_COLORS-}" ]; then
|
||||||
@@ -45,22 +49,22 @@ nvm_download() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
|
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
|
||||||
OUTPUT="$(nvm ls-remote --lts | sed 's/[ \t]*$//')"
|
OUTPUT="$(nvm ls-remote --lts | strip_colors | sed 's/[ \t]*$//')"
|
||||||
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
|
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
|
||||||
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote --lts did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote --lts did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
||||||
|
|
||||||
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
|
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt"
|
||||||
OUTPUT="$(nvm ls-remote "lts/*" | sed 's/[ \t]*$//')"
|
OUTPUT="$(nvm ls-remote "lts/*" | strip_colors | sed 's/[ \t]*$//')"
|
||||||
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
|
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
|
||||||
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote lts/* did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "nvm ls-remote lts/* did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
||||||
|
|
||||||
LTS_LIST="$(cat "${LTS_NAMES_PATH}" | tail -n +2)"
|
LTS_LIST="$(cat "${LTS_NAMES_PATH}" | tail -n +2)"
|
||||||
|
|
||||||
INDEX=1
|
INDEX=1
|
||||||
printf '%s\n' "${LTS_LIST}" | while IFS= read -r LTS; do
|
printf '%s\n' "${LTS_LIST}" | while IFS= read -r LTS; do
|
||||||
ACTUAL="$(nvm ls-remote "lts/-${INDEX}" | sed 's/[ \t]*$//')"
|
ACTUAL="$(nvm ls-remote "lts/-${INDEX}" | strip_colors | sed 's/[ \t]*$//')"
|
||||||
MESSAGE="for lts/-${INDEX} (${LTS})"
|
MESSAGE="for lts/-${INDEX} (${LTS})"
|
||||||
EXPECTED="$(nvm ls-remote "lts/${LTS}" | sed 's/[ \t]*$//')"
|
EXPECTED="$(nvm ls-remote "lts/${LTS}" | strip_colors | sed 's/[ \t]*$//')"
|
||||||
[ "${ACTUAL}" = "${EXPECTED}" ] || die "${MESSAGE}: expected >${EXPECTED}<, got >${ACTUAL}<"
|
[ "${ACTUAL}" = "${EXPECTED}" ] || die "${MESSAGE}: expected >${EXPECTED}<, got >${ACTUAL}<"
|
||||||
|
|
||||||
INDEX=$(($INDEX + 1))
|
INDEX=$(($INDEX + 1))
|
||||||
@@ -69,6 +73,7 @@ done
|
|||||||
OUTPUT="$(nvm ls-remote lts/ARGON 2>&1)"
|
OUTPUT="$(nvm ls-remote lts/ARGON 2>&1)"
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
[ $EXIT_CODE -eq 3 ] || die "nvm ls-remote lts/ARGON did not exit 3, got '${EXIT_CODE}'"
|
[ $EXIT_CODE -eq 3 ] || die "nvm ls-remote lts/ARGON did not exit 3, got '${EXIT_CODE}'"
|
||||||
|
OUTPUT="$(echo "${OUTPUT}" | strip_colors)"
|
||||||
|
|
||||||
EXPECTED_OUTPUT="LTS names must be lowercase
|
EXPECTED_OUTPUT="LTS names must be lowercase
|
||||||
N/A"
|
N/A"
|
||||||
@@ -84,8 +89,8 @@ nvm_ls_remote_iojs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote.txt"
|
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote.txt"
|
||||||
OUTPUT="$(nvm ls-remote | sed 's/[ \t]*$//')"
|
OUTPUT="$(nvm ls-remote | strip_colors | sed 's/[ \t]*$//')"
|
||||||
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | sed 's/[ \t]*$//' )"
|
EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}" | strip_colors | sed 's/[ \t]*$//' )"
|
||||||
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "bare nvm ls-remote did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
[ "_${OUTPUT}" = "_${EXPECTED_OUTPUT}" ] || die "bare nvm ls-remote did not output expected sorted versions; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<"
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user