From f98d33bfa5f04d8697d9dd7faaff1f83ec958664 Mon Sep 17 00:00:00 2001 From: Archi Date: Fri, 17 Dec 2021 14:09:55 +0100 Subject: [PATCH] CI: Try to limit OOM on Windows --- .github/workflows/publish.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e1727cbe..1583f1e31 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -325,9 +325,18 @@ jobs: foreach ($variant in $env:VARIANTS.Split([char[]] $null, [System.StringSplitOptions]::RemoveEmptyEntries)) { Start-Job -Name "$variant" $PublishBlock -ArgumentList "$variant" + + # Limit active jobs in parallel to help with memory usage + $jobs = $(Get-Job -State Running) + + while (@($jobs).Count -ge 5) { + Wait-Job -Job $jobs -Any | Out-Null + + $jobs = $(Get-Job -State Running) + } } - Get-Job | Receive-Job -Wait + Get-Job | Receive-Job -Wait -AutoRemoveJob - name: Upload ASF-generic continue-on-error: true