From e81cf0d1a5d7f57e3190e83210b6e71e56371a5c Mon Sep 17 00:00:00 2001 From: andrius Date: Wed, 1 Nov 2023 23:45:00 +0000 Subject: [PATCH] fixes for unofficial build --- .github/workflows/windows-npm.yml | 39 +++++++++++++++++++- nvm.sh | 2 +- test/fast/Unit tests/nvm_get_arch_unofficial | 4 +- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-npm.yml b/.github/workflows/windows-npm.yml index e2652bb127a..34094d5f39b 100644 --- a/.github/workflows/windows-npm.yml +++ b/.github/workflows/windows-npm.yml @@ -99,7 +99,6 @@ jobs: matrix: wsl-distrib: - Debian - - Alpine - Ubuntu-18.04 npm-node-version: - '--lts' @@ -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: diff --git a/nvm.sh b/nvm.sh index 9e49b6d31b8..89121bdeb85 100644 --- a/nvm.sh +++ b/nvm.sh @@ -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}" diff --git a/test/fast/Unit tests/nvm_get_arch_unofficial b/test/fast/Unit tests/nvm_get_arch_unofficial index 4eae810be87..12c5da0f955 100755 --- a/test/fast/Unit tests/nvm_get_arch_unofficial +++ b/test/fast/Unit tests/nvm_get_arch_unofficial @@ -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() {