Skip to content

Commit cdcbcdc

Browse files
committed
Use RAM disk for windows GitHub action to speed up the build.
Use only for temp dir. If used for workspace, we run out of space. Drive D is already used for workspace. See why D and RAM disks should be used: https://www.chadgolden.com/blog/github-actions-hosted-windows-runners-slower-than-expected-ci-and-you#windows-dev-drive--virtual-hard-disk-vhdx
1 parent 4bc3c7a commit cdcbcdc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/build-macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build GlassFish on MacOS
33
on:
44
pull_request:
55
branches: [ "master", "7.0", "8.0" ]
6+
permissions:
7+
checks: write # Write permission required by the action-junit-report action
68
jobs:
79
build:
810
runs-on: macos-15

.github/workflows/build-windows.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@ name: Build GlassFish on Windows
33
on:
44
pull_request:
55
branches: [ "master", "7.0", "8.0" ]
6+
permissions:
7+
checks: write # Write permission required by the action-junit-report action
68
jobs:
79
build:
810
runs-on: windows-2025
911
name: Build GlassFish on Windows
1012
steps:
1113
- uses: actions/checkout@v4
14+
- name: Setup RAM Disk
15+
uses: chad-golden/[email protected]
16+
with:
17+
size-in-mb: 8096
18+
- name: Setup directories in RAM Disk
19+
run: |
20+
mkdir R:\temp
21+
echo "TEMP=R:\temp" >> $env:GITHUB_ENV
22+
echo "TMP=R:\temp" >> $env:GITHUB_ENV
1223
- name: Set up JDK
1324
uses: actions/setup-java@v4
1425
with:
@@ -31,4 +42,6 @@ jobs:
3142
if: success() || failure() # do not run if build cancelled
3243
with:
3344
report_paths: '**/target/surefire-reports/TEST-*.xml'
34-
token: ${{ secrets.GITHUB_TOKEN }}
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
- name: Dismount RAM Disk
47+
uses: chad-golden/setup-ramdisk/[email protected]

0 commit comments

Comments
 (0)