From c41093c695cf059ce8c82c2cad9d983d4f830230 Mon Sep 17 00:00:00 2001 From: cesnimda Date: Sat, 29 Aug 2026 01:45:30 +0200 Subject: [PATCH] ci: retry corrupt NuGet restores --- .gitea/workflows/ci-deploy.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci-deploy.yml b/.gitea/workflows/ci-deploy.yml index c35111e..f3212f9 100644 --- a/.gitea/workflows/ci-deploy.yml +++ b/.gitea/workflows/ci-deploy.yml @@ -60,12 +60,21 @@ jobs: # without contacting Ollama, pulling a model, or requiring package installation. run: python3 scripts/test-ollama-evaluation.py - - name: Build backend - # Roslyn has intermittently exited 139 on this resource-constrained runner after a - # successful restore. Retry once without compiler-server or parallel build processes; - # the same complete project is still compiled and warnings/errors remain fatal. + - name: Restore backend + # The runner/proxy has occasionally supplied checksum-invalid NuGet cache entries (NU3008). + # Retry from clean HTTP/global caches; signature verification remains enabled. run: | - dotnet build JobTrackerApi/JobTrackerApi.csproj --configuration Release \ + restore() { dotnet restore JobTrackerApi/JobTrackerApi.csproj; } + restore || ( echo "Backend restore failed ($?) — clearing runner NuGet caches and retrying once..." \ + && dotnet nuget locals http-cache --clear \ + && dotnet nuget locals global-packages --clear \ + && dotnet restore JobTrackerApi/JobTrackerApi.csproj --no-cache ) + + - name: Build backend + # Roslyn has intermittently exited 139 on this resource-constrained runner. Retry once + # without compiler-server or parallel build processes; restore failures are handled above. + run: | + dotnet build JobTrackerApi/JobTrackerApi.csproj --configuration Release --no-restore \ || ( echo "Backend compiler crashed ($?) — retrying single-process..." \ && dotnet build JobTrackerApi/JobTrackerApi.csproj --configuration Release \ --no-restore --disable-build-servers --maxcpucount:1 \ @@ -79,7 +88,10 @@ jobs: - name: Restore backend tests run: | restore() { dotnet restore JobTrackerApi.Tests/JobTrackerApi.Tests.csproj; } - restore || ( echo "NuGet restore failed ($?) — retrying once..." && restore ) + restore || ( echo "NuGet restore failed ($?) — clearing runner caches and retrying once..." \ + && dotnet nuget locals http-cache --clear \ + && dotnet nuget locals global-packages --clear \ + && dotnet restore JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --no-cache ) - name: Build backend tests run: |