From 7b4051412b6e47b6ebd39e2afbb5ad5390e997fa Mon Sep 17 00:00:00 2001 From: Simone Date: Sun, 17 May 2026 21:42:47 +0200 Subject: [PATCH] feat(ci): expose guest-cpu/guest-memory-mb; ns7zip Linux 8GB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit job.py already patches the clone VMX (numvcpus/memsize) via --guest-cpu/--guest-memory-mb; expose them as action inputs (default '0' = keep template). build-ns7zip.yml sets guest-memory-mb: 8192 — the parallel MinGW cross-compile thrashes at the 4 GB Linux template default (Windows template is 6 GB). Co-Authored-By: Claude Opus 4.7 --- .gitea/actions/local-ci-build/action.yml | 21 +++++++++++++++++++++ .gitea/workflows/build-ns7zip.yml | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/.gitea/actions/local-ci-build/action.yml b/.gitea/actions/local-ci-build/action.yml index 8564e98..da6c4c2 100644 --- a/.gitea/actions/local-ci-build/action.yml +++ b/.gitea/actions/local-ci-build/action.yml @@ -156,6 +156,22 @@ inputs: required: false default: '{}' + guest-cpu: + description: > + Override the build VM vCPU count (numvcpus in the clone VMX). + "0" (default) keeps the template value. + required: false + default: '0' + + guest-memory-mb: + description: > + Override the build VM RAM in MB (memsize in the clone VMX). + "0" (default) keeps the template value. Raise for memory-heavy + parallel builds (e.g. the Linux MinGW cross-compile thrashes at + the 4 GB template default). + required: false + default: '0' + use-shared-cache: description: > Set to "true" to redirect NuGet and pip caches to VMware shared folders @@ -212,6 +228,8 @@ runs: INPUT_EXTRA_GUEST_ENV_JSON: ${{ inputs.extra-guest-env-json }} INPUT_USE_SHARED_CACHE: ${{ inputs.use-shared-cache }} INPUT_SKIP_ARTIFACT: ${{ inputs.skip-artifact }} + INPUT_GUEST_CPU: ${{ inputs.guest-cpu }} + INPUT_GUEST_MEMORY_MB: ${{ inputs.guest-memory-mb }} run: | #Requires -Version 5.1 Set-StrictMode -Version Latest @@ -325,6 +343,9 @@ runs: else { $pyArgs += '--use-git-clone' } if ($env:INPUT_USE_SHARED_CACHE -eq 'true') { $pyArgs += '--use-shared-cache' } if ($env:INPUT_SKIP_ARTIFACT -eq 'true') { $pyArgs += '--skip-artifact' } + # VMX overrides: forward only when > 0 (0 = keep template value). + if ([int]($env:INPUT_GUEST_CPU) -gt 0) { $pyArgs += @('--guest-cpu', $env:INPUT_GUEST_CPU) } + if ([int]($env:INPUT_GUEST_MEMORY_MB) -gt 0) { $pyArgs += @('--guest-memory-mb', $env:INPUT_GUEST_MEMORY_MB) } if ($env:INPUT_EXTRA_GUEST_ENV_JSON -and $env:INPUT_EXTRA_GUEST_ENV_JSON -ne '{}') { $pyArgs += @('--extra-env-json', $env:INPUT_EXTRA_GUEST_ENV_JSON) } diff --git a/.gitea/workflows/build-ns7zip.yml b/.gitea/workflows/build-ns7zip.yml index 1b40648..5dd1c52 100644 --- a/.gitea/workflows/build-ns7zip.yml +++ b/.gitea/workflows/build-ns7zip.yml @@ -46,6 +46,10 @@ jobs: # Cross-repo build: github.ref_name is this repo's branch, not # nsis-plugin-ns7zip's. Pin the target repo's branch. repo-branch: 'main' + # 8 GB: the parallel MinGW cross-compile thrashes at the 4 GB + # Linux template default (3 concurrent make -j). Harmless for + # Windows (host has ample RAM). + guest-memory-mb: '8192' # Suffix disambiguates artifact dirs: F:\CI\Artifacts\{run_id}-{attempt}-windows job-id-suffix: '${{ matrix.target }}' artifact-name: 'nsis-plugin-ns7zip-${{ matrix.target }}-${{ github.ref_name }}'