Skip to content

Commit 41d4d9f

Browse files
committed
Fixed build-test-windows.yml
Signed-off-by: Daniel Fiala <[email protected]>
1 parent 79bf2fe commit 41d4d9f

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

.github/workflows/build-test-windows.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
version: [ "22.8.0" ]
24+
version: [ "22.9.0" ]
2525
variant: [ "windowsservercore-ltsc2019" ]
2626

2727
steps:
@@ -49,19 +49,19 @@ jobs:
4949
exit 1
5050
}
5151
52-
- name: Verify entrypoint runs regular, non-executable files with node
52+
- name: Verify node runs regular files
5353
shell: pwsh
5454
run: |
5555
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
5656
$tmp_file = Join-Path $tempDir "index.js"
5757
"console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
58-
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} C:/app/index.js)
58+
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} node C:/app/index.js)
5959
if ($output -ne 'success') {
60-
Write-Host "Invalid"
60+
exit 1
6161
}
6262
6363
- name: Test for npm
64-
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
64+
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} powershell.exe npm --version
6565

6666
build-windows-2022:
6767
name: build-windows-2022
@@ -70,7 +70,7 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
version: [ "22.8.0" ]
73+
version: [ "22.9.0" ]
7474
variant: [ "windowsservercore-ltsc2022" ]
7575

7676
steps:
@@ -110,4 +110,5 @@ jobs:
110110
}
111111
112112
- name: Test for npm
113-
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
113+
# We need to use powershell.exe to run npm because docker needs to attach to process and npm is a batch file/powershell script
114+
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} powershell.exe npm --version

22/windowsservercore-ltsc2019/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as installer
1+
FROM mcr.microsoft.com/windows/servercore:ltsc2019
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

@@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
1818
Remove-Item node.zip -Force ; \
1919
node --version; \
2020
npm --version;
21-
22-
CMD [ "node.exe" ]

22/windowsservercore-ltsc2022/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/windows/servercore:ltsc2022 as installer
1+
FROM mcr.microsoft.com/windows/servercore:ltsc2022
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

@@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
1818
Remove-Item node.zip -Force ; \
1919
node --version; \
2020
npm --version;
21-
22-
CMD [ "node.exe" ]

Dockerfile-windows.template

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/windows/servercore:version as installer
1+
FROM mcr.microsoft.com/windows/servercore:version
22

33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

@@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
1818
Remove-Item node.zip -Force ; \
1919
node --version; \
2020
npm --version;
21-
22-
CMD [ "node.exe" ]

0 commit comments

Comments
 (0)