Skip to content
Myr

[actions] rename `windows-npm` workflow to `windows-nvm`, since it tests `nvm install`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 04ac3f2 · Browse files · 2 files+281 added−281 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+281 added−281 removed

  • other:+281 added−281 removed

2 files+281 added−281 removed

deleted:.github/workflows/windows-npm.yml-281 removed
1name: 'Tests on Windows: `nvm install`'23on: [pull_request, push]45permissions:6 contents: read78env:9 NVM_INSTALL_GITHUB_REPO: ${{ github.repository }}10 NVM_INSTALL_VERSION: ${{ github.sha }}1112jobs:13 msys_fail_install:14 # Default installation does not work due to npm_config_prefix set to C:\npm\prefix15 permissions:16 contents: none17 name: 'MSYS fail prefix nvm install'18 runs-on: windows-latest19 steps:20 - name: Retrieve nvm21 shell: bash22 run: |23 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash24 . "$HOME/.nvm/nvm.sh"25 ! nvm install --lts2627 msys_matrix:28 permissions:29 contents: none30 name: 'MSYS nvm install'31 runs-on: windows-latest32 strategy:33 fail-fast: false34 matrix:35 npm-node-version:36 - '--lts'37 - '--default 12'38 - '--no-progress 10'39 steps:40 - name: Retrieve nvm41 shell: bash42 run: |43 unset npm_config_prefix44 if [ "${{ matrix.npm-node-version }}" = "--lts" ]; then45 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash46 else47 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash48 fi49 . "$HOME/.nvm/nvm.sh"50 nvm install ${{ matrix.npm-node-version }}5152 cygwin_matrix:53 continue-on-error: true54 permissions:55 contents: none56 name: 'Cygwin nvm install'57 runs-on: windows-latest58 steps:59 - name: Install Cygwin60 shell: bash61 run: |62 export SITE='https://mirror.clarkson.edu/cygwin/' # see https://archlinux.org/mirrors/clarkson.edu/1603/ for uptime status63 export SITE='https://mirrors.kernel.org/sourceware/cygwin/'64 export LOCALDIR="$(pwd)"65 export ROOTDIR="$USERPROFILE\\cygwin"66 export PACKAGES='bash,git,curl'6768 curl -fsSLo setup-x86_64.exe 'https://cygwin.com/setup-x86_64.exe'69 ./setup-x86_64.exe --disable-buggy-antivirus -q -s "$SITE" -l "$LOCALDIR" -R "$ROOTDIR" -P "$PACKAGES"7071 cat >~/setup.sh <<EOM72 unset npm_config_prefix73 export NVM_INSTALL_GITHUB_REPO="$NVM_INSTALL_GITHUB_REPO"74 export NVM_INSTALL_VERSION="$NVM_INSTALL_VERSION"75 export HOME="$(cygpath -u "$USERPROFILE")"7677 echo "HOME is $HOME"78 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash79 ls -l $HOME/.nvm80 . "$HOME/.nvm/nvm.sh"81 nvm install --lts8283 nvm deactivate84 rm -rf "$HOME/.nvm/nvm.sh"8586 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash87 . "$HOME/.nvm/nvm.sh"88 nvm install 989 EOM90 - name: Retrieve nvm91 shell: cmd92 run: |93 cd %USERPROFILE%\cygwin\bin94 bash.exe "%USERPROFILE%\setup.sh"9596 wsl_matrix:97 permissions:98 contents: none99 continue-on-error: true100 name: 'WSL nvm install'101 defaults:102 run:103 shell: wsl-bash {0}104 runs-on: windows-latest105 env:106 WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p107 strategy:108 fail-fast: false109 matrix:110 # each line gets a pin, plus the newest setup-wsl offers for it; the111 # newest only moves when the action's major does, so bumping the `uses:`112 # ref below is what keeps this current113 wsl-distrib:114 - Debian-12115 - Debian-13116 # - Alpine-3.17 # fails117 - Ubuntu-20.04118 - Ubuntu-24.04119 - Ubuntu-18.04120 npm-node-version:121 - '--lts'122 - '21'123 - '18'124 - '16'125 - '14'126 - '12'127 - '10'128 exclude:129 - wsl-distrib: Ubuntu-18.04130 npm-node-version: '--lts'131 - wsl-distrib: Ubuntu-18.04132 npm-node-version: '21'133 - wsl-distrib: Ubuntu-18.04134 npm-node-version: '18'135 # node v24+ doesn't work on WSL1 (exec format error)136 - wsl-distrib: Debian-12137 npm-node-version: '--lts'138 - wsl-distrib: Debian-13139 npm-node-version: '--lts'140 - wsl-distrib: Ubuntu-20.04141 npm-node-version: '--lts'142 - wsl-distrib: Ubuntu-24.04143 npm-node-version: '--lts'144 method:145 - ''146 - 'script'147 steps:148 # For Ubuntu: install with packages directly149 - if: ${{ !startsWith(matrix.wsl-distrib, 'Debian') }}150 uses: Vampire/setup-wsl@v7151 with:152 distribution: ${{ matrix.wsl-distrib }}153 additional-packages: bash git curl ca-certificates wget154155 # For Debian, install without packages: `additional-packages` would run156 # `apt-get update` before we get to fix up sources.list157 # see https://github.com/Vampire/setup-wsl/issues/76158 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}159 uses: Vampire/setup-wsl@v7160 with:161 distribution: ${{ matrix.wsl-distrib }}162 # Debian's mirror layout shifts as a release ages out of LTS: main moves to163 # archive.debian.org, and the security suite is both renamed and moved, on164 # its own schedule. Offer every layout and let `apt-get update` discard the165 # ones that 404, so this needs no edits as the image's release ages.166 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}167 name: 'Point apt at whichever mirrors still carry this release'168 shell: 'wsl-bash {0}'169 run: |170 codename="$(. /etc/os-release && printf '%s' "${VERSION_CODENAME-}")"171 if [ -z "${codename}" ]; then172 echo 'no VERSION_CODENAME in /etc/os-release' >&2173 exit 1174 fi175 # Debian 13 moved to deb822; drop both formats so what we write is the176 # only thing apt reads, whichever release is pinned177 rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources178 {179 echo "deb http://deb.debian.org/debian ${codename} main"180 echo "deb http://archive.debian.org/debian ${codename} main"181 echo "deb http://security.debian.org/debian-security ${codename}-security main"182 echo "deb http://archive.debian.org/debian-security ${codename}-security main"183 echo "deb http://archive.debian.org/debian-security ${codename}/updates main"184 } >/etc/apt/sources.list185 cat /etc/apt/sources.list186 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}187 name: 'Install packages with retries'188 shell: 'wsl-bash {0}'189 run: |190 retry() {191 local n=0192 local max=3193 local delay=5194 while true; do195 "$@" && break || {196 n=$((n+1))197 if [ $n -lt $max ]; then198 echo "Command failed. Attempt $n/$max. Retrying in $delay seconds..."199 sleep $delay200 else201 echo "Command failed after $max attempts."202 return 1203 fi204 }205 done206 }207 packages=(bash git curl ca-certificates wget)208 retry apt-get update || true209 if ! retry apt-get install --yes "${packages[@]}"; then210 # a security index can outlive the pool objects it advertises, which211 # no retry resolves; main is complete once a release is archived212 sed -i '/debian-security/d' /etc/apt/sources.list213 retry apt-get update || true214 retry apt-get install --yes "${packages[@]}"215 fi216217 - name: Retrieve nvm on WSL218 run: |219 if [ -z "${{ matrix.method }}" ]; then220 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash221 else222 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash223 fi224 . "$HOME/.nvm/nvm.sh"225 nvm install ${{ matrix.npm-node-version }}226 node -v227228 wsl_matrix_unofficial:229 permissions:230 contents: none231 continue-on-error: true232 name: 'WSL nvm install'233 defaults:234 run:235 shell: wsl-bash {0}236 runs-on: windows-latest237 env:238 WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p239 NVM_NODEJS_ORG_MIRROR: https://unofficial-builds.nodejs.org/download/release240 strategy:241 fail-fast: false242 matrix:243 wsl-distrib:244 - Alpine-3.17245 - Alpine-3.23246 npm-node-version:247 - '--lts'248 - '21'249 - '18'250 - '16'251 - '14'252 - '12'253 - '11'254 - '10'255 method:256 - ''257 - 'script'258 steps:259 - uses: Vampire/setup-wsl@v7260 with:261 distribution: ${{ matrix.wsl-distrib }}262 additional-packages: bash git curl ca-certificates wget263264 - name: Retrieve nvm on WSL265 run: |266 if [ -z "${{ matrix.method }}" ]; then267 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash268 else269 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash270 fi271 . "$HOME/.nvm/nvm.sh"272 NVM_NODEJS_ORG_MIRROR=${{ env.NVM_NODEJS_ORG_MIRROR }} nvm install ${{ matrix.npm-node-version }}273274 nvm_windows:275 name: 'tests, on windows'276 permissions:277 contents: none278 needs: [wsl_matrix, wsl_matrix_unofficial, cygwin_matrix, msys_matrix, msys_fail_install]279 runs-on: ubuntu-latest280 steps:281 - run: true
added:.github/workflows/windows-nvm.yml+281 added
1name: 'Tests on Windows: `nvm install`'23on: [pull_request, push]45permissions:6 contents: read78env:9 NVM_INSTALL_GITHUB_REPO: ${{ github.repository }}10 NVM_INSTALL_VERSION: ${{ github.sha }}1112jobs:13 msys_fail_install:14 # Default installation does not work due to npm_config_prefix set to C:\npm\prefix15 permissions:16 contents: none17 name: 'MSYS fail prefix nvm install'18 runs-on: windows-latest19 steps:20 - name: Retrieve nvm21 shell: bash22 run: |23 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash24 . "$HOME/.nvm/nvm.sh"25 ! nvm install --lts2627 msys_matrix:28 permissions:29 contents: none30 name: 'MSYS nvm install'31 runs-on: windows-latest32 strategy:33 fail-fast: false34 matrix:35 npm-node-version:36 - '--lts'37 - '--default 12'38 - '--no-progress 10'39 steps:40 - name: Retrieve nvm41 shell: bash42 run: |43 unset npm_config_prefix44 if [ "${{ matrix.npm-node-version }}" = "--lts" ]; then45 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash46 else47 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash48 fi49 . "$HOME/.nvm/nvm.sh"50 nvm install ${{ matrix.npm-node-version }}5152 cygwin_matrix:53 continue-on-error: true54 permissions:55 contents: none56 name: 'Cygwin nvm install'57 runs-on: windows-latest58 steps:59 - name: Install Cygwin60 shell: bash61 run: |62 export SITE='https://mirror.clarkson.edu/cygwin/' # see https://archlinux.org/mirrors/clarkson.edu/1603/ for uptime status63 export SITE='https://mirrors.kernel.org/sourceware/cygwin/'64 export LOCALDIR="$(pwd)"65 export ROOTDIR="$USERPROFILE\\cygwin"66 export PACKAGES='bash,git,curl'6768 curl -fsSLo setup-x86_64.exe 'https://cygwin.com/setup-x86_64.exe'69 ./setup-x86_64.exe --disable-buggy-antivirus -q -s "$SITE" -l "$LOCALDIR" -R "$ROOTDIR" -P "$PACKAGES"7071 cat >~/setup.sh <<EOM72 unset npm_config_prefix73 export NVM_INSTALL_GITHUB_REPO="$NVM_INSTALL_GITHUB_REPO"74 export NVM_INSTALL_VERSION="$NVM_INSTALL_VERSION"75 export HOME="$(cygpath -u "$USERPROFILE")"7677 echo "HOME is $HOME"78 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash79 ls -l $HOME/.nvm80 . "$HOME/.nvm/nvm.sh"81 nvm install --lts8283 nvm deactivate84 rm -rf "$HOME/.nvm/nvm.sh"8586 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD=script bash87 . "$HOME/.nvm/nvm.sh"88 nvm install 989 EOM90 - name: Retrieve nvm91 shell: cmd92 run: |93 cd %USERPROFILE%\cygwin\bin94 bash.exe "%USERPROFILE%\setup.sh"9596 wsl_matrix:97 permissions:98 contents: none99 continue-on-error: true100 name: 'WSL nvm install'101 defaults:102 run:103 shell: wsl-bash {0}104 runs-on: windows-latest105 env:106 WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p107 strategy:108 fail-fast: false109 matrix:110 # each line gets a pin, plus the newest setup-wsl offers for it; the111 # newest only moves when the action's major does, so bumping the `uses:`112 # ref below is what keeps this current113 wsl-distrib:114 - Debian-12115 - Debian-13116 # - Alpine-3.17 # fails117 - Ubuntu-20.04118 - Ubuntu-24.04119 - Ubuntu-18.04120 npm-node-version:121 - '--lts'122 - '21'123 - '18'124 - '16'125 - '14'126 - '12'127 - '10'128 exclude:129 - wsl-distrib: Ubuntu-18.04130 npm-node-version: '--lts'131 - wsl-distrib: Ubuntu-18.04132 npm-node-version: '21'133 - wsl-distrib: Ubuntu-18.04134 npm-node-version: '18'135 # node v24+ doesn't work on WSL1 (exec format error)136 - wsl-distrib: Debian-12137 npm-node-version: '--lts'138 - wsl-distrib: Debian-13139 npm-node-version: '--lts'140 - wsl-distrib: Ubuntu-20.04141 npm-node-version: '--lts'142 - wsl-distrib: Ubuntu-24.04143 npm-node-version: '--lts'144 method:145 - ''146 - 'script'147 steps:148 # For Ubuntu: install with packages directly149 - if: ${{ !startsWith(matrix.wsl-distrib, 'Debian') }}150 uses: Vampire/setup-wsl@v7151 with:152 distribution: ${{ matrix.wsl-distrib }}153 additional-packages: bash git curl ca-certificates wget154155 # For Debian, install without packages: `additional-packages` would run156 # `apt-get update` before we get to fix up sources.list157 # see https://github.com/Vampire/setup-wsl/issues/76158 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}159 uses: Vampire/setup-wsl@v7160 with:161 distribution: ${{ matrix.wsl-distrib }}162 # Debian's mirror layout shifts as a release ages out of LTS: main moves to163 # archive.debian.org, and the security suite is both renamed and moved, on164 # its own schedule. Offer every layout and let `apt-get update` discard the165 # ones that 404, so this needs no edits as the image's release ages.166 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}167 name: 'Point apt at whichever mirrors still carry this release'168 shell: 'wsl-bash {0}'169 run: |170 codename="$(. /etc/os-release && printf '%s' "${VERSION_CODENAME-}")"171 if [ -z "${codename}" ]; then172 echo 'no VERSION_CODENAME in /etc/os-release' >&2173 exit 1174 fi175 # Debian 13 moved to deb822; drop both formats so what we write is the176 # only thing apt reads, whichever release is pinned177 rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources178 {179 echo "deb http://deb.debian.org/debian ${codename} main"180 echo "deb http://archive.debian.org/debian ${codename} main"181 echo "deb http://security.debian.org/debian-security ${codename}-security main"182 echo "deb http://archive.debian.org/debian-security ${codename}-security main"183 echo "deb http://archive.debian.org/debian-security ${codename}/updates main"184 } >/etc/apt/sources.list185 cat /etc/apt/sources.list186 - if: ${{ startsWith(matrix.wsl-distrib, 'Debian') }}187 name: 'Install packages with retries'188 shell: 'wsl-bash {0}'189 run: |190 retry() {191 local n=0192 local max=3193 local delay=5194 while true; do195 "$@" && break || {196 n=$((n+1))197 if [ $n -lt $max ]; then198 echo "Command failed. Attempt $n/$max. Retrying in $delay seconds..."199 sleep $delay200 else201 echo "Command failed after $max attempts."202 return 1203 fi204 }205 done206 }207 packages=(bash git curl ca-certificates wget)208 retry apt-get update || true209 if ! retry apt-get install --yes "${packages[@]}"; then210 # a security index can outlive the pool objects it advertises, which211 # no retry resolves; main is complete once a release is archived212 sed -i '/debian-security/d' /etc/apt/sources.list213 retry apt-get update || true214 retry apt-get install --yes "${packages[@]}"215 fi216217 - name: Retrieve nvm on WSL218 run: |219 if [ -z "${{ matrix.method }}" ]; then220 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash221 else222 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash223 fi224 . "$HOME/.nvm/nvm.sh"225 nvm install ${{ matrix.npm-node-version }}226 node -v227228 wsl_matrix_unofficial:229 permissions:230 contents: none231 continue-on-error: true232 name: 'WSL nvm install'233 defaults:234 run:235 shell: wsl-bash {0}236 runs-on: windows-latest237 env:238 WSLENV: NVM_INSTALL_GITHUB_REPO:NVM_INSTALL_VERSION:/p239 NVM_NODEJS_ORG_MIRROR: https://unofficial-builds.nodejs.org/download/release240 strategy:241 fail-fast: false242 matrix:243 wsl-distrib:244 - Alpine-3.17245 - Alpine-3.23246 npm-node-version:247 - '--lts'248 - '21'249 - '18'250 - '16'251 - '14'252 - '12'253 - '11'254 - '10'255 method:256 - ''257 - 'script'258 steps:259 - uses: Vampire/setup-wsl@v7260 with:261 distribution: ${{ matrix.wsl-distrib }}262 additional-packages: bash git curl ca-certificates wget263264 - name: Retrieve nvm on WSL265 run: |266 if [ -z "${{ matrix.method }}" ]; then267 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | bash268 else269 curl -fsSLo- "https://raw.githubusercontent.com/${NVM_INSTALL_GITHUB_REPO}/${NVM_INSTALL_VERSION}/install.sh" | METHOD="${{matrix.method}}" bash270 fi271 . "$HOME/.nvm/nvm.sh"272 NVM_NODEJS_ORG_MIRROR=${{ env.NVM_NODEJS_ORG_MIRROR }} nvm install ${{ matrix.npm-node-version }}273274 nvm_windows:275 name: 'tests, on windows'276 permissions:277 contents: none278 needs: [wsl_matrix, wsl_matrix_unofficial, cygwin_matrix, msys_matrix, msys_fail_install]279 runs-on: ubuntu-latest280 steps:281 - run: true