File tree 5 files changed +248
-123
lines changed
5 files changed +248
-123
lines changed Original file line number Diff line number Diff line change @@ -150,3 +150,36 @@ jobs:
150
150
run : node . test -w smoke-tests --ignore-scripts
151
151
- name : Check Git Status
152
152
run : node scripts/git-dirty.js
153
+
154
+ windows-shims :
155
+ name : Windows Shims Tests
156
+ runs-on : windows-latest
157
+ defaults :
158
+ run :
159
+ shell : cmd
160
+ steps :
161
+ - name : Checkout
162
+ uses : actions/checkout@v3
163
+ - name : Setup Git User
164
+ run : |
165
+ git config --global user.email "npm-cli+bot@github.com"
166
+ git config --global user.name "npm CLI robot"
167
+ - name : Setup Node
168
+ uses : actions/setup-node@v3
169
+ with :
170
+ node-version : 18.x
171
+ cache : npm
172
+ - name : Reset Deps
173
+ run : node scripts/resetdeps.js
174
+ - name : Setup WSL
175
+ uses : Vampire/setup-wsl@v2.0.1
176
+ - name : Set up Cygwin
177
+ uses : egor-tensin/setup-cygwin@v4.0.1
178
+ with :
179
+ install-dir : C:\Windows\cygwin64
180
+ - name : Run Windows Shims Tests
181
+ run : node . test --ignore-scripts -- test/bin/windows-shims.js --no-coverage
182
+ env :
183
+ WINDOWS_SHIMS_TEST : fail
184
+ - name : Check Git Status
185
+ run : node scripts/git-dirty.js
Original file line number Diff line number Diff line change @@ -9,18 +9,27 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
9
}
10
10
$ret = 0
11
11
12
- $nodebin = $ (Get-Command " node$exe " - ErrorAction SilentlyContinue - ErrorVariable F).Source
12
+ $nodeexe = " node$exe "
13
+ $nodebin = $ (Get-Command $nodeexe - ErrorAction SilentlyContinue - ErrorVariable F).Source
13
14
if ($nodebin -eq $null ) {
14
- Write-Host " node $exe not found."
15
+ Write-Host " $nodeexe not found."
15
16
exit 1
16
17
}
17
18
$nodedir = $ (New-Object - ComObject Scripting.FileSystemObject).GetFile(" $nodebin " ).ParentFolder.Path
18
19
20
+ $npmclijs = " $nodedir /node_modules/npm/bin/npm-cli.js"
21
+ $npmprefix = (& $nodeexe $npmclijs prefix - g)
22
+ if ($LASTEXITCODE -ne 0 ) {
23
+ Write-Host " Could not determine Node.js install directory"
24
+ exit 1
25
+ }
26
+ $npmprefixclijs = " $npmprefix /node_modules/npm/bin/npm-cli.js"
27
+
19
28
# Support pipeline input
20
29
if ($MyInvocation.ExpectingInput ) {
21
- $input | & " node $exe " " $nodedir /node_modules/npm/bin/npm-cli.js " $args
30
+ $input | & $nodeexe $npmprefixclijs $args
22
31
} else {
23
- & " node $exe " " $nodedir /node_modules/npm/bin/npm-cli.js " $args
32
+ & $nodeexe $npmprefixclijs $args
24
33
}
25
34
$ret = $LASTEXITCODE
26
35
exit $ret
Original file line number Diff line number Diff line change @@ -9,18 +9,27 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
9
}
10
10
$ret = 0
11
11
12
- $nodebin = $ (Get-Command " node$exe " - ErrorAction SilentlyContinue - ErrorVariable F).Source
12
+ $nodeexe = " node$exe "
13
+ $nodebin = $ (Get-Command $nodeexe - ErrorAction SilentlyContinue - ErrorVariable F).Source
13
14
if ($nodebin -eq $null ) {
14
- Write-Host " node $exe not found."
15
+ Write-Host " $nodeexe not found."
15
16
exit 1
16
17
}
17
18
$nodedir = $ (New-Object - ComObject Scripting.FileSystemObject).GetFile(" $nodebin " ).ParentFolder.Path
18
19
20
+ $npmclijs = " $nodedir /node_modules/npm/bin/npm-cli.js"
21
+ $npmprefix = (& $nodeexe $npmclijs prefix - g)
22
+ if ($LASTEXITCODE -ne 0 ) {
23
+ Write-Host " Could not determine Node.js install directory"
24
+ exit 1
25
+ }
26
+ $npmprefixclijs = " $npmprefix /node_modules/npm/bin/npx-cli.js"
27
+
19
28
# Support pipeline input
20
29
if ($MyInvocation.ExpectingInput ) {
21
- $input | & " node $exe " " $nodedir /node_modules/npm/bin/npx-cli.js " $args
30
+ $input | & $nodeexe $npmprefixclijs $args
22
31
} else {
23
- & " node $exe " " $nodedir /node_modules/npm/bin/npx-cli.js " $args
32
+ & $nodeexe $npmprefixclijs $args
24
33
}
25
34
$ret = $LASTEXITCODE
26
35
exit $ret
Original file line number Diff line number Diff line change 11
11
run : {{rootNpmPath}} test -w smoke-tests --ignore-scripts
12
12
- name : Check Git Status
13
13
run : node scripts/git-dirty.js
14
+
15
+ windows-shims :
16
+ name : Windows Shims Tests
17
+ runs-on : windows-latest
18
+ defaults :
19
+ run :
20
+ shell : cmd
21
+ steps :
22
+ {{> stepsSetup }}
23
+ - name : Setup WSL
24
+ uses : Vampire/setup-wsl@v2.0.1
25
+ - name : Set up Cygwin
26
+ uses : egor-tensin/setup-cygwin@v4.0.1
27
+ with :
28
+ install-dir : C:\Windows\cygwin64
29
+ - name : Run Windows Shims Tests
30
+ run : {{rootNpmPath}} test --ignore-scripts -- test/bin/windows-shims.js --no-coverage
31
+ env :
32
+ WINDOWS_SHIMS_TEST : fail
33
+ - name : Check Git Status
34
+ run : node scripts/git-dirty.js
You can’t perform that action at this time.
0 commit comments