Skip to content

Commit

Permalink
Fixed build-test-windows.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Fiala <[email protected]>
  • Loading branch information
zZHorizonZz committed Sep 20, 2024
1 parent 79bf2fe commit 41d4d9f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ "22.8.0" ]
version: [ "22.9.0" ]
variant: [ "windowsservercore-ltsc2019" ]

steps:
Expand Down Expand Up @@ -49,19 +49,19 @@ jobs:
exit 1
}
- name: Verify entrypoint runs regular, non-executable files with node
- name: Verify node runs regular files
shell: pwsh
run: |
$tempDir = New-Item -ItemType Directory -Path $env:TEMP -Name "tempNodeApp"
$tmp_file = Join-Path $tempDir "index.js"
"console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} C:/app/index.js)
$output = (docker run --rm -w /app --mount "type=bind,src=$tempDir,target=c:\app" node:${{ matrix.version }}-${{ matrix.variant }} node C:/app/index.js)
if ($output -ne 'success') {
Write-Host "Invalid"
exit 1
}
- name: Test for npm
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} powershell.exe npm --version

build-windows-2022:
name: build-windows-2022
Expand All @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ "22.8.0" ]
version: [ "22.9.0" ]
variant: [ "windowsservercore-ltsc2022" ]

steps:
Expand Down Expand Up @@ -110,4 +110,5 @@ jobs:
}
- name: Test for npm
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
# We need to use powershell.exe to run npm because docker needs to attach to process and npm is a batch file/powershell script
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} powershell.exe npm --version
4 changes: 1 addition & 3 deletions 22/windowsservercore-ltsc2019/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as installer
FROM mcr.microsoft.com/windows/servercore:ltsc2019

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

Expand All @@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Remove-Item node.zip -Force ; \
node --version; \
npm --version;

CMD [ "node.exe" ]
4 changes: 1 addition & 3 deletions 22/windowsservercore-ltsc2022/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2022 as installer
FROM mcr.microsoft.com/windows/servercore:ltsc2022

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

Expand All @@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Remove-Item node.zip -Force ; \
node --version; \
npm --version;

CMD [ "node.exe" ]
4 changes: 1 addition & 3 deletions Dockerfile-windows.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/windows/servercore:version as installer
FROM mcr.microsoft.com/windows/servercore:version

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

Expand All @@ -18,5 +18,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Remove-Item node.zip -Force ; \
node --version; \
npm --version;

CMD [ "node.exe" ]

0 comments on commit 41d4d9f

Please sign in to comment.