Skip to content

Commit

Permalink
fixes for unofficial build
Browse files Browse the repository at this point in the history
  • Loading branch information
asolopovas committed Nov 1, 2023
1 parent e421c6e commit e81cf0d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/windows-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ jobs:
matrix:
wsl-distrib:
- Debian
- Alpine
- Ubuntu-18.04
npm-node-version:
- '--lts'
Expand All @@ -125,6 +124,44 @@ jobs:
. "$HOME/.nvm/nvm.sh"
nvm install ${{ matrix.npm-node-version }}
wsl_matrix_unofficial:
name: 'WSL nvm install'
defaults:
run:
shell: wsl-bash {0}
runs-on: windows-latest
env:
WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p
NVM_NODEJS_ORG_MIRROR: https://unofficial-builds.nodejs.org/download/release
strategy:
fail-fast: false
matrix:
wsl-distrib:
- Alpine
npm-node-version:
- '--lts'
- '14'
- '12'
- '11'
- '10'
method:
- ''
- 'script'
steps:
- uses: Vampire/setup-wsl@v1
with:
distribution: ${{ matrix.wsl-distrib }}
additional-packages: bash git curl ca-certificates wget
- name: Retrieve nvm on WSL
run: |
if [ -z "${{ matrix.method }}" ]; 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="${{matrix.method}}" bash
fi
. "$HOME/.nvm/nvm.sh"
nvm install ${{ matrix.npm-node-version }}
nvm_windows:
name: 'tests, on windows'
permissions:
Expand Down
2 changes: 1 addition & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ nvm_get_arch() {
fi

if [ -f "/etc/alpine-release" ]; then
NVM_ARCH=musl-x64
NVM_ARCH=x64-musl
fi

nvm_echo "${NVM_ARCH}"
Expand Down
4 changes: 2 additions & 2 deletions test/fast/Unit tests/nvm_get_arch_unofficial
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ setup_chroot "${CHROOT_WITHOUT_ALPINE}"

# Run tests in chroot environments
ARCH_WITH_ALPINE=$(sudo chroot "${CHROOT_WITH_ALPINE}" /bin/sh -c ". ./nvm.sh && nvm_get_arch")
[ "${ARCH_WITH_ALPINE}" = "musl-x64" ] || die "Expected musl-x64 for alpine environment but got ${ARCH_WITH_ALPINE}"
[ "${ARCH_WITH_ALPINE}" = "x64-musl" ] || die "Expected x64-musl for alpine environment but got ${ARCH_WITH_ALPINE}"

ARCH_WITHOUT_ALPINE=$(sudo chroot "${CHROOT_WITHOUT_ALPINE}" /bin/sh -c ". ./nvm.sh && nvm_get_arch")
[ "${ARCH_WITHOUT_ALPINE}" != "musl-x64" ] || die "Did not expect musl-x64 for non-alpine environment"
[ "${ARCH_WITHOUT_ALPINE}" != "x64-musl" ] || die "Did not expect x64-musl for non-alpine environment"

# Run tests for nvm ls-remote
test_default_ls_remote() {
Expand Down

0 comments on commit e81cf0d

Please sign in to comment.