diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index e0f724126cb..dc681305821 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -67,18 +67,19 @@ runs: if: runner.os == 'Windows' shell: pwsh run: | - fsutil file createnew virtual_test_disk.img 4GB - - echo SELECT VDISK FILE=virtual_test_disk.img > mount_script.txt - echo ATTACH VDISK >> mount_script.txt - diskpart /s mount_script.txt + fsutil file createnew virtual_test_disk.img 4294967296 + + echo SELECT VDISK FILE=virtual_test_disk.img > diskpart_script.txt + echo ATTACH VDISK >> diskpart_script.txt + echo LIST VOLUME >> diskpart_script.txt + diskpart /s diskpart_script.txt > diskpart_output.txt echo LIST VOLUME > list_volumes.txt - for /f "tokens=1-3" %%a in ('diskpart /s list_volumes.txt') do ( - if "%%c"=="virtual_test_disk.img" ( - echo "TARGET_DRIVE=%%a:\\" >> %GITHUB_ENV% - ) + for /f "tokens=2,3 delims= " %%a in ('find "virtual_test_disk.img" diskpart_output.txt') do ( + set drive_letter=%%a ) + + echo "TARGET_DRIVE=!drive_letter!:\\" >> %GITHUB_ENV% - name: Test release shell: bash