@@ -3,25 +3,76 @@ name: build-test-windows
3
3
on :
4
4
push :
5
5
paths :
6
- - " **/windows/Dockerfile"
6
+ - " **/windows-2019/Dockerfile"
7
+ - " **/windows-2022/Dockerfile"
7
8
- " .github/workflows/build-test-windows.yml"
8
9
9
10
pull_request :
10
11
paths :
11
- - " **/windows/Dockerfile"
12
- - genMatrix.js
12
+ - " **/windows-2019 /Dockerfile"
13
+ - " **/windows-2022/Dockerfile "
13
14
- " .github/workflows/build-test-windows.yml"
14
15
15
16
jobs :
16
- build :
17
- name : build
17
+ build-windows-2019 :
18
+ name : build-windows-2019
18
19
runs-on : windows-2019
19
20
timeout-minutes : 60
20
21
strategy :
21
22
fail-fast : false
22
23
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" ]
25
76
26
77
steps :
27
78
- name : Get short node version
0 commit comments