[actions] migrate Travis CI tests to GitHub Actions

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:
Jordan Harband
2026-01-20 20:17:42 -08:00
parent ec8906b284
commit d0bf268db2
7 changed files with 419 additions and 112 deletions

24
nvm.sh
View File

@@ -2788,11 +2788,15 @@ nvm_die_on_prefix() {
# 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.
# however, `npm exec` in npm v7.2+ sets $PREFIX; if set, inherit it
if [ -n "${PREFIX-}" ] && [ "$(nvm_version_path "$(node -v)")" != "${PREFIX}" ]; then
nvm deactivate >/dev/null 2>&1
nvm_err "nvm is not compatible with the \"PREFIX\" environment variable: currently set to \"${PREFIX}\""
nvm_err 'Run `unset PREFIX` to unset it.'
return 3
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_err "nvm is not compatible with the \"PREFIX\" environment variable: currently set to \"${PREFIX}\""
nvm_err 'Run `unset PREFIX` to unset it.'
return 3
fi
fi
local NVM_OS
@@ -4624,24 +4628,24 @@ nvm_auto() {
VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
if [ -n "${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
return 0
fi
elif nvm_rc_version >/dev/null 2>&1; then
nvm use --silent >/dev/null
nvm use --silent >/dev/null || :
fi
else
nvm use --silent "${NVM_CURRENT}" >/dev/null
nvm use --silent "${NVM_CURRENT}" >/dev/null || :
fi
;;
install)
local VERSION
VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
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
nvm install >/dev/null
nvm install >/dev/null || :
else
return 0
fi