From 4a1dd94deebd30a55bcb73c2992f493506b115e1 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Wed, 25 Nov 2026 21:04:39 +0100 Subject: [PATCH] =?UTF-8?q?CI:=20anche=20=C2=ABrelease=C2=BB=20costruisce?= =?UTF-8?q?=20l'installatore=20senza=20ICU,=20e=20una=20prova=20lo=20tiene?= =?UTF-8?q?=20fermo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Il lavoro «release» di rilascio.yml costruisce l'installatore sull'immagine del runner come «windows» e «installatore»: prende anche lui DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true. Nuova prova PipelineTests.EveryJobThatBuildsTheInstallerOnTheRunnerImageNeedsNoIcu: ogni lavoro di verifica.yml e rilascio.yml che lancia installer/costruisci.sh fuori dal contenitore delle prove deve averla (fallisce se la si toglie). Il commento di dotnet.sh non dice più che ICU è nell'immagine del runner. Co-Authored-By: Claude Opus 5.5 --- .gitea/scripts/dotnet.sh | 5 ++-- .gitea/workflows/rilascio.yml | 3 +++ tests/Febe.Tests/Packaging/PipelineTests.cs | 26 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.gitea/scripts/dotnet.sh b/.gitea/scripts/dotnet.sh index 6993970..5f46e48 100644 --- a/.gitea/scripts/dotnet.sh +++ b/.gitea/scripts/dotnet.sh @@ -11,8 +11,9 @@ # lavoro, anche nei contenitori), in febe-dotnet/; senza, nella cartella temporanea del lavoro. Una versione # già installata e verificata non si riscarica; le versioni più vecchie di febe-dotnet si tolgono. Aggiunge dotnet al # PATH dei passi seguenti (GITHUB_PATH) e scrive DOTNET_ROOT (GITHUB_ENV); fuori dalla CI stampa solo la cartella. -# Serve curl, tar, sha512sum e awk; le librerie di sistema dell'SDK (ICU, OpenSSL) ci sono già nell'immagine del runner -# e le installa ambiente-prove.sh nel contenitore Debian delle prove. +# Serve curl, tar, sha512sum e awk. Nel contenitore Debian delle prove le librerie di sistema dell'SDK (ICU, OpenSSL) +# le installa ambiente-prove.sh; sull'immagine del runner ICU non è garantito, e i lavori che ci girano (installatore, +# windows, release) usano DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true. set -euo pipefail canale="${1:-10.0}" diff --git a/.gitea/workflows/rilascio.yml b/.gitea/workflows/rilascio.yml index b0fbc55..a35fe9c 100644 --- a/.gitea/workflows/rilascio.yml +++ b/.gitea/workflows/rilascio.yml @@ -296,6 +296,9 @@ jobs: # contenitore, la scansione o la spinta sul registro falliscono, non esce nessuna release. needs: [prove, windows, immagine] timeout-minutes: 40 + env: + # Come «windows»: l'immagine del runner non garantisce ICU, e per costruire l'installatore non serve. + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: "true" steps: - name: Sorgenti env: diff --git a/tests/Febe.Tests/Packaging/PipelineTests.cs b/tests/Febe.Tests/Packaging/PipelineTests.cs index 446a4ee..609744b 100644 --- a/tests/Febe.Tests/Packaging/PipelineTests.cs +++ b/tests/Febe.Tests/Packaging/PipelineTests.cs @@ -55,6 +55,32 @@ public sealed partial class PipelineTests } } + [TestMethod] + public void EveryJobThatBuildsTheInstallerOnTheRunnerImageNeedsNoIcu() + { + // The runner image does not guarantee ICU (run 431 stopped at dotnet publish without it). A job that runs + // installer/costruisci.sh outside the Debian container of the tests must put .NET in invariant globalization. + var seen = 0; + foreach (var name in new[] { "verifica.yml", "rilascio.yml" }) + { + var text = Workflow(name); + foreach (Match header in JobHeader().Matches(text)) + { + var job = Job(text, header.Groups["name"].Value); + var code = Code(job); + if (!code.Contains("installer/costruisci.sh", StringComparison.Ordinal) || code.Contains("container:", StringComparison.Ordinal)) + { + continue; + } + + seen++; + StringAssert.Contains(code, "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: \"true\"", $"{name}: {header.Groups["name"].Value}"); + } + } + + Assert.IsGreaterThanOrEqualTo(3, seen, "installatore, windows and release build the installer on the runner image"); + } + [TestMethod] public void TheWholeSolutionIsBuiltAndTheTestsRunOnlyThroughTheTestProjectWithTheBrowser() {