|
1 |
| -name: "Setup ImDisk" |
| 1 | +name: "Setup Arsenal Image Mounter" |
2 | 2 | if: runner.os == 'Windows'
|
3 | 3 | description: |
|
4 |
| - Sets up the ImDisk toolkit for Windows and backs often-used paths with RAM disks |
| 4 | + Sets up the Arsenal Image Mounter for Windows and backs often-used paths with RAM disks |
5 | 5 | runs:
|
6 | 6 | using: "composite"
|
7 | 7 | steps:
|
8 |
| - - name: Download ImDisk |
9 |
| - if: runner.os == 'Windows' |
| 8 | + - name: Download and install Arsenal Image Mounter |
10 | 9 | shell: bash
|
11 | 10 | 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 .. |
| 11 | + set -e |
17 | 12 |
|
18 |
| - - name: Install ImDisk |
19 |
| - shell: cmd |
20 |
| - run: | |
21 |
| - cd imdisk |
22 |
| - install.bat /silent |
| 13 | + cd ~/ |
| 14 | +
|
| 15 | + mkdir aim |
| 16 | + cd aim |
| 17 | + curl -L -o aim_ll.zip https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/5961f922c5b99ec29acc4af4b60b909b402eed95/Command%20line%20applications/aim_ll.zip |
| 18 | + # unzip properly extracts everything but warns that "aim_ll.zip appears to use backslashes as path separators" |
| 19 | + # it then exits with a non-zero status code. the warning is harmless, so we ignore it. |
| 20 | + unzip aim_ll.zip || true |
| 21 | + mkdir ~/bin |
| 22 | + mv x64/* ~/bin |
| 23 | +
|
| 24 | + curl -L -o DriverFiles.zip https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/5961f922c5b99ec29acc4af4b60b909b402eed95/DriverSetup/DriverFiles.zip |
| 25 | + # like above |
| 26 | + unzip DriverFiles.zip -d DriverFiles || true |
| 27 | + aim_ll --install DriverFiles |
23 | 28 |
|
24 | 29 | - name: Create RAM Disks
|
25 | 30 | shell: bash
|
26 | 31 | run: |
|
27 | 32 | # RAM disk for postgres mounted on R:
|
28 |
| - imdisk -a -s 4096M -m R: -p "/fs:ntfs /q /y" |
| 33 | + aim_ll -a -s "90%" -m R: -p "/fs:ntfs /q /y" |
29 | 34 |
|
30 | 35 | # RAM disk for temp files. It's used by actions/cache, actions/setup-go, etc.
|
31 | 36 | # We need to persist the existing contents because some actions rely on it.
|
32 | 37 | mkdir "$RUNNER_TEMP"_tmp
|
33 | 38 | cp -r "$RUNNER_TEMP"/. "$RUNNER_TEMP"_tmp
|
34 | 39 | rm -rf "$RUNNER_TEMP"/*
|
35 |
| - imdisk -a -s 8192M -m "$RUNNER_TEMP" -p "/fs:ntfs /q /y" |
| 40 | + aim_ll -a -s "90%" -m "$RUNNER_TEMP" -p "/fs:ntfs /q /y" |
36 | 41 | cp -r "$RUNNER_TEMP"_tmp/. "$RUNNER_TEMP"
|
37 | 42 | rm -rf "$RUNNER_TEMP"_tmp
|
38 | 43 |
|
39 |
| - # RAM disk for go cache and mod cache |
40 |
| - # cd to another directory to ensure we're not inside a go project. |
41 |
| - # That'd trigger go to download the toolchain for that project. |
42 |
| - cd "$RUNNER_TEMP" |
43 |
| - export GOCACHE="$(go env GOCACHE)" |
44 |
| - export GOMODCACHE="$(go env GOMODCACHE)" |
45 |
| - rm -rf "$GOCACHE" |
46 |
| - rm -rf "$GOMODCACHE" |
47 |
| - mkdir -p "$GOCACHE" |
48 |
| - mkdir -p "$GOMODCACHE" |
49 |
| - imdisk -a -s 8192M -m "$GOCACHE" -p "/fs:ntfs /q /y" |
50 |
| - imdisk -a -s 8192M -m "$GOMODCACHE" -p "/fs:ntfs /q /y" |
51 |
| -
|
52 | 44 | # RAM disk for the repository
|
53 | 45 | rm -rf "$GITHUB_WORKSPACE"/*
|
54 | 46 | # Use exfat instead of ntfs because ntfs creates an unremovable
|
55 | 47 | # "System Volume Information" directory that makes actions/checkout fail.
|
56 | 48 | # exfat is empty on creation
|
57 |
| - imdisk -a -s 2048M -m "$GITHUB_WORKSPACE" -p "/fs:exfat /q /y" |
| 49 | + aim_ll -a -s "90%" -m "$GITHUB_WORKSPACE" -p "/fs:exfat /q /y" |
58 | 50 | # node's fs.promises.readdir used by actions/checkout fails if the
|
59 | 51 | # directory is empty.
|
60 | 52 | touch "$GITHUB_WORKSPACE"/dummy.txt
|
0 commit comments