Skip to content

Commit

Permalink
build: update CI for npm TLS upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Oct 13, 2021
1 parent 9f1fee2 commit e501201
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions appveyor.yml
@@ -1,6 +1,5 @@
environment:
matrix:
- nodejs_version: "0.8"
- nodejs_version: "0.10"
- nodejs_version: "4.9"
- nodejs_version: "6.17"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e501201

Please sign in to comment.