Skip to content

Commit ea04198

Browse files
committed
fix: try to workaround old npm not being able to update in windows
1 parent a77cec5 commit ea04198

File tree

3 files changed

+60
-38
lines changed

3 files changed

+60
-38
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ jobs:
4545
- uses: actions/setup-node@v2
4646
with:
4747
node-version: ${{ matrix.node-version }}
48-
- run: npm i --prefer-online -g npm@latest
48+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
49+
- name: Update to workable npm (windows)
50+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
51+
run: |
52+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
53+
tar xf npm-7.5.4.tgz
54+
cd package
55+
dir
56+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
57+
cd ..
58+
rmdir /s /q package
59+
- name: Update npm
60+
run: |
61+
npm -v
62+
npm i --prefer-online --no-fund --no-audit -g npm@latest
63+
npm -v
4964
- run: npm i
5065
- run: npm test --ignore-scripts

lib/content/ci-workspace.yml

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
pull_request:
55
paths:
66
- %%pkgpath%%/**
7-
branches:
8-
- '*'
97
push:
108
paths:
119
- %%pkgpath%%/**
@@ -20,55 +18,49 @@ jobs:
2018
steps:
2119
# Checkout the npm/cli repo
2220
- uses: actions/checkout@v2
23-
- name: Use Node.js 16.x
24-
uses: actions/setup-node@v2
21+
- uses: actions/setup-node@v2
2522
with:
26-
node-version: 16.x
27-
cache: npm
28-
- name: Install dependencies
29-
run: |
30-
node ./bin/npm-cli.js install --ignore-scripts --no-audit
31-
node ./bin/npm-cli.js rebuild
32-
- name: Run linting
33-
run: node ./bin/npm-cli.js run posttest -w %%pkgpath%%
34-
env:
35-
DEPLOY_VERSION: testing
23+
node-version: '16'
24+
- run: npm i --prefer-online -g npm@latest
25+
- run: npm i
26+
- run: npm run lint -w %%pkgpath%%
3627

3728
test:
3829
strategy:
3930
fail-fast: false
4031
matrix:
41-
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.0.0', 16.x]
32+
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
4233
platform:
4334
- os: ubuntu-latest
4435
shell: bash
4536
- os: macos-latest
4637
shell: bash
4738
- os: windows-latest
4839
shell: cmd
49-
5040
runs-on: ${{ matrix.platform.os }}
5141
defaults:
5242
run:
5343
shell: ${{ matrix.platform.shell }}
54-
5544
steps:
56-
# Checkout the npm/cli repo
57-
- uses: actions/checkout@v2
58-
59-
# Installs the specific version of Node.js
60-
- name: Use Node.js ${{ matrix.node-version }}
61-
uses: actions/setup-node@v2
62-
with:
63-
node-version: ${{ matrix.node-version }}
64-
cache: npm
65-
66-
# Run the installer script
67-
- name: Install dependencies
68-
run: |
69-
node ./bin/npm-cli.js install --ignore-scripts --no-audit
70-
node ./bin/npm-cli.js rebuild
71-
72-
# Run the tests, but not if we're just gonna do coveralls later anyway
73-
- name: Run Tap tests
74-
run: node ./bin/npm-cli.js run -w %%pkgpath%% --ignore-scripts test -- -t600 -Rbase -c
45+
- uses: actions/checkout@v2
46+
- uses: actions/setup-node@v2
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
50+
- name: Update to workable npm (windows)
51+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
52+
run: |
53+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
54+
tar xf npm-7.5.4.tgz
55+
cd package
56+
dir
57+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
58+
cd ..
59+
rmdir /s /q package
60+
- name: Update npm
61+
run: |
62+
npm -v
63+
npm i --prefer-online --no-fund --no-audit -g npm@latest
64+
npm -v
65+
- run: npm i
66+
- run: npm test --ignore-scripts -w %%pkgpath%%

lib/content/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ jobs:
4545
- uses: actions/setup-node@v2
4646
with:
4747
node-version: ${{ matrix.node-version }}
48-
- run: npm i --prefer-online -g npm@latest
48+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
49+
- name: Update to workable npm (windows)
50+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
51+
run: |
52+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
53+
tar xf npm-7.5.4.tgz
54+
cd package
55+
dir
56+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
57+
cd ..
58+
rmdir /s /q package
59+
- name: Update npm
60+
run: |
61+
npm -v
62+
npm i --prefer-online --no-fund --no-audit -g npm@latest
63+
npm -v
4964
- run: npm i
5065
- run: npm test --ignore-scripts

0 commit comments

Comments
 (0)