77 type : string
88 description : Job selection (Python regex)
99 required : false
10- pull_request :
10+ workflow_call :
11+ inputs :
12+ jobs_to_run :
13+ required : true
14+ type : string
1115 schedule :
1216 - cron : ' 0 0 * * 1'
1317
1822 matrix : ${{ steps.set-matrix.outputs.matrix }}
1923 env :
2024 TARGET : tier1
21- JOBS : ${{ inputs.jobs_to_run || (github.event_name == 'schedule' && 'python-svm-build-gate-linux|python-unittest-retagger|python-unittest-retagger-merge') || '' }}
25+ JOBS : ${{ inputs.jobs_to_run }}
2226 steps : &generate_matrix
2327 - uses : actions/checkout@v4
2428 - name : Download sjsonnet
@@ -122,7 +126,7 @@ jobs:
122126
123127 # Setup mx, buildtools and labsjdk
124128 - name : Get mx, buildtools, and labsjdk
125- if : ${{ runner.os != 'Windows' && matrix.mx_version }}
129+ if : ${{ matrix.mx_version }}
126130 shell : bash
127131 run : |
128132 git clone https://github.com/graalvm/mx
@@ -186,8 +190,59 @@ jobs:
186190 run : |
187191 ${{ matrix.setup_steps }}
188192
189- - name : Check disk space
190- run : df -h
193+ - name : Check disk space and memory usage
194+ if : ${{ runner.os == 'macOS' }}
195+ run : |
196+ echo "before purge"
197+ df -h
198+ pagesize=$(sysctl -n hw.pagesize)
199+ vm_stat
200+ vm_stat | awk -v ps=$pagesize '
201+ /Pages free/ {free=$3}
202+ /Pages active/ {active=$3}
203+ /Pages inactive/ {inactive=$3}
204+ /Pages speculative/ {speculative=$3}
205+ /Pages wired/ {wired=$4}
206+ END {
207+ used=(active+inactive+wired+speculative)*ps/1024/1024;
208+ free=free*ps/1024/1024;
209+ printf "Used: %.2f MB\nFree: %.2f MB\n", used, free
210+ }'
211+ ps aux | sort -nrk 4 | head
212+ sudo purge
213+ echo "after purge"
214+ pagesize=$(sysctl -n hw.pagesize)
215+ vm_stat
216+ vm_stat | awk -v ps=$pagesize '
217+ /Pages free/ {free=$3}
218+ /Pages active/ {active=$3}
219+ /Pages inactive/ {inactive=$3}
220+ /Pages speculative/ {speculative=$3}
221+ /Pages wired/ {wired=$4}
222+ END {
223+ used=(active+inactive+wired+speculative)*ps/1024/1024;
224+ free=free*ps/1024/1024;
225+ printf "Used: %.2f MB\nFree: %.2f MB\n", used, free
226+ }'
227+
228+
229+ - name : Free resources on macOS
230+ run : |
231+ echo "Disabling Spotlight indexing..."
232+ sudo mdutil -a -i off
233+ sudo mdutil -a -d
234+ sudo launchctl bootout system /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
235+ sudo pkill -f "mds|mds_stores|mdworker_shared|Spotlight|corespotlightd"
236+
237+ echo "Forcing disk cache to be purged..."
238+ sudo purge
239+
240+ echo "Top processes sorted by memory usage:"
241+ ps -emo pid,pmem,pcpu,comm | head 2>/dev/null
242+ echo ""
243+ memory_pressure
244+ echo ""
245+ if : ${{ runner.os == 'macOS' }}
191246
192247 - name : Run on Unix
193248 working-directory : main
@@ -196,6 +251,7 @@ jobs:
196251 env
197252 ${{ matrix.run_steps }}
198253 - name : Run on Windows
254+ working-directory : main
199255 if : ${{ matrix.run_steps && runner.os == 'Windows' }}
200256 shell : cmd
201257 run : |
0 commit comments