@@ -3,25 +3,76 @@ name: build-test-windows
33on :
44 push :
55 paths :
6- - " **/windows/Dockerfile"
6+ - " **/windows-2019/Dockerfile"
7+ - " **/windows-2022/Dockerfile"
78 - " .github/workflows/build-test-windows.yml"
89
910 pull_request :
1011 paths :
11- - " **/windows/Dockerfile"
12- - genMatrix.js
12+ - " **/windows-2019 /Dockerfile"
13+ - " **/windows-2022/Dockerfile "
1314 - " .github/workflows/build-test-windows.yml"
1415
1516jobs :
16- build :
17- name : build
17+ build-windows-2019 :
18+ name : build-windows-2019
1819 runs-on : windows-2019
1920 timeout-minutes : 60
2021 strategy :
2122 fail-fast : false
2223 matrix :
23- version : [ 22 ]
24- variant : [ "windows" ]
24+ version : [ "22.7.0" ]
25+ variant : [ "windows-2019" ]
26+
27+ steps :
28+ - name : Get short node version
29+ uses : actions/github-script@v7
30+ id : short-version
31+ with :
32+ result-encoding : string
33+ script : return "${{ matrix.version }}".split('.')[0]
34+
35+ - name : Checkout
36+ uses : actions/checkout@v4
37+
38+ - name : Build image
39+ run : |
40+ docker build --file ./${{ steps.short-version.outputs.result }}/${{ matrix.variant }}/Dockerfile --tag node:${{ matrix.version }}-${{ matrix.variant }} .
41+
42+ - name : Test for node version
43+ shell : pwsh
44+ run : |
45+ $image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node")
46+ Write-Host "Expected: '${{ matrix.version }}', Got: '$image_node_version'"
47+ if ($image_node_version -ne ${{ matrix.version }}) {
48+ exit 1
49+ }
50+
51+ - name : Verify entrypoint runs regular, non-executable files with node
52+ shell : pwsh
53+ run : |
54+ $tmp_file = New-TemporaryFile
55+ "console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
56+ $output = (docker run --rm -v "${{ github.workspace }}\$tmp_file:/app/index.js" node:${{ matrix.version }}-${{ matrix.variant }} app/index.js)
57+ if ($output -ne 'success') {
58+ exit 1
59+ }
60+
61+ - name : Test for npm
62+ run : docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
63+
64+ - name : Test for yarn
65+ run : docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} yarn --version
66+
67+ build-windows-2022 :
68+ name : build-windows-2022
69+ runs-on : windows-2022
70+ timeout-minutes : 60
71+ strategy :
72+ fail-fast : false
73+ matrix :
74+ version : [ "22.7.0" ]
75+ variant : [ "windows-2022" ]
2576
2677 steps :
2778 - name : Get short node version
0 commit comments