File tree 1 file changed +26
-17
lines changed
.github/actions/setup-imdisk
1 file changed +26
-17
lines changed Original file line number Diff line number Diff line change 1
- name : " Setup ImDisk "
1
+ name : " Setup OSFMount "
2
2
if : runner.os == 'Windows'
3
3
description : |
4
- Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
4
+ Installs OSFmount for Windows and creates a RAM disk on drive R:.
5
5
runs :
6
6
using : " composite"
7
7
steps :
8
- - name : Download ImDisk
8
+ - name : Install OSFMount
9
9
if : runner.os == 'Windows'
10
- shell : bash
10
+ shell : pwsh
11
11
run : |
12
- mkdir imdisk
13
- cd imdisk
14
- curl -L -o files.cab https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/files.cab
15
- curl -L -o install.bat https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/install.bat
16
- cd ..
17
-
18
- - name : Install ImDisk
19
- shell : cmd
20
- run : |
21
- cd imdisk
22
- install.bat /silent
12
+ $ErrorActionPreference = "Stop"
13
+ & curl.exe `
14
+ --progress-bar `
15
+ --show-error `
16
+ --fail `
17
+ --location `
18
+ --output osfmount.exe `
19
+ $env:OSFMOUNT_URL
20
+ if ($LASTEXITCODE -ne 0) { throw "Failed to download osfmount.exe" }
21
+ if ((Get-FileHash osfmount.exe -Algorithm SHA256).Hash -ne $env:OSFMOUNT_SHA256) {
22
+ throw "Failed to verify osfmount.exe"
23
+ }
24
+ & .\osfmount.exe /silent /norestart
25
+ if ($LASTEXITCODE -ne 0) { throw "Failed to install osfmount.exe" }
26
+ Remove-Item osfmount.exe
27
+ env :
28
+ OSFMOUNT_URL : https://storage.googleapis.com/coder-osfmount-binaries/osfmount-v3.1.1003.exe
29
+ OSFMOUNT_SHA256 : 9fe0738b7c2d29a7414e67f53aea359f3801d1c37b44f1b4fed5d02cb7536369
23
30
24
31
- name : Create RAM Disk
25
- shell : cmd
32
+ shell : pwsh
26
33
run : |
27
- imdisk -a -s 4096M -m R: -p "/fs:ntfs /q /y"
34
+ $ErrorActionPreference = "Stop"
35
+ & OSFMount.com -a -s 4096M -m R: -o logical,format:NTFS
36
+ if ($LASTEXITCODE -ne 0) { throw "Failed to create RAM disk" }
You can’t perform that action at this time.
0 commit comments