From e501201955dec5eb3badcd235194dee9ca225fe9 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 12 Oct 2021 21:50:00 -0400 Subject: [PATCH] build: update CI for npm TLS upgrade --- .github/workflows/ci.yml | 10 ++++++++-- appveyor.yml | 13 ++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a07b1f..4d90cb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,14 @@ jobs: shell: bash -eo pipefail -l {0} run: | nvm install --default ${{ matrix.node-version }} - if [[ "${{ matrix.node-version }}" == 0.* ]]; then npm config set strict-ssl false; fi - if [[ "${{ matrix.node-version }}" == 0.8 ]]; then npm install -g npm@1.2.8000; fi + if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then + nvm install --alias=npm 0.10 + npm install -g npm@1.2.8000 + NPM=$(which npm) + nvm use ${{ matrix.node-version }} + ln -fs "$NPM" "$(which npm)" + sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" + fi dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" - name: Configure npm diff --git a/appveyor.yml b/appveyor.yml index a9e2be9..dfd44f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - nodejs_version: "0.8" - nodejs_version: "0.10" - nodejs_version: "4.9" - nodejs_version: "6.17" @@ -16,23 +15,18 @@ install: catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) } # Setup npm - for /f "tokens=*" %%g in ('where npm') do (set npm_prefix=%%~dpg) - - if "%nodejs_version%" equ "0.8" npm config set strict-ssl false - - if "%nodejs_version%" equ "0.8" npm install -g --prefix "%npm_prefix:~0,-1%" npm@1.2.8000 - npm config set shrinkwrap false # Remove all non-test dependencies - npm rm --silent --save-dev eslint eslint-plugin-markdown nyc # Setup Node.js version-specific dependencies - ps: | # mocha for testing - # - use 2.x for Node.js < 0.10 # - use 3.x for Node.js < 4 # - use 5.x for Node.js < 6 # - use 6.x for Node.js < 8 # - use 7.x for Node.js < 10 # - use 8.x for Node.js < 12 - if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) { - npm install --silent --save-dev mocha@2.5.3 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) { + if ([int]$env:nodejs_version.split(".")[0] -lt 4) { npm install --silent --save-dev mocha@3.5.3 } elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) { npm install --silent --save-dev mocha@5.2.0 @@ -45,12 +39,9 @@ install: } - ps: | # supertest for http calls - # - use 1.1.0 for Node.js < 0.10 # - use 2.0.0 for Node.js < 4 # - use 3.4.2 for Node.js < 6 - if ([int]$env:nodejs_version.split(".")[0] -eq 0 -and [int]$env:nodejs_version.split(".")[1] -lt 10) { - npm install --silent --save-dev supertest@1.1.0 - } elseif ([int]$env:nodejs_version.split(".")[0] -lt 4) { + if ([int]$env:nodejs_version.split(".")[0] -lt 4) { npm install --silent --save-dev supertest@2.0.0 } elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) { npm install --silent --save-dev supertest@3.4.2