Skip to content

Commit 69d8718

Browse files
committed
Fixed tests for windows
1 parent db0671b commit 69d8718

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,26 @@ jobs:
3939
docker build --file ./${{ steps.short-version.outputs.result }}/${{ matrix.variant }}/Dockerfile --tag node:${{ matrix.version }}-${{ matrix.variant }} .
4040
4141
- name: Test for node version
42+
shell: pwsh
4243
run: |
43-
image_node_version=$(docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node")
44-
echo "Expected: \"${{ matrix.version }}\", Got: \"${image_node_version}\""
45-
[ "${image_node_version}" == "${{ matrix.version }}" ]
46-
44+
$image_node_version = (docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} node --print "process.versions.node")
45+
Write-Host "Expected: '${{ matrix.version }}', Got: '$image_node_version'"
46+
if ($image_node_version -ne ${{ matrix.version }}) {
47+
exit 1
48+
}
49+
4750
- name: Verify entrypoint runs regular, non-executable files with node
51+
shell: pwsh
4852
run: |
49-
tmp_file=$(mktemp)
50-
echo 'console.log("success")' > "${tmp_file}"
51-
output=$(docker run --rm -v "${tmp_file}:/app/index.js" node:${{ matrix.version }}-${{ matrix.variant }} app/index.js)
52-
[ "${output}" = 'success' ]
53-
53+
$tmp_file = New-TemporaryFile
54+
"console.log('success')" | Out-File -FilePath $tmp_file -Encoding utf8
55+
$output = (docker run --rm -v "${{ github.workspace }}\$tmp_file:/app/index.js" node:${{ matrix.version }}-${{ matrix.variant }} app/index.js)
56+
if ($output -ne 'success') {
57+
exit 1
58+
}
59+
5460
- name: Test for npm
5561
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
56-
62+
5763
- name: Test for yarn
5864
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} yarn --version

0 commit comments

Comments
 (0)