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() {