From 60df0845aaf5b5c145e6b7c155357226db7571f5 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Mon, 13 Jul 2026 15:29:11 +0200 Subject: [PATCH] ci: cache the NuGet package store across the .NET jobs (refs #73) lint, build, unit and mutation each restored packages from the network on every run. There are no lock files (so setup-dotnet's built-in cache doesn't apply), so cache ~/.nuget/packages keyed on the project files via actions/cache. Pinned @v3 to avoid the GHES guard that breaks @v4 on Gitea (gitea-actions-gotchas.md); the cache is best-effort, so a miss simply restores from the network. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/ci.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 4e3a624..2aff002 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -23,6 +23,16 @@ jobs: - uses: https://github.com/actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' + # Cache the NuGet package store so each .NET job restores from disk, not the network. There are + # no lock files (so setup-dotnet's built-in cache doesn't apply); key on the project files. @v3 + # avoids the GHES guard that breaks @v4 on Gitea (gitea-actions-gotchas.md); cache is best-effort + # — a miss just restores from the network. See issue #73. + - uses: https://github.com/actions/cache@v3 + with: + path: ~/.nuget/packages + key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} + restore-keys: | + nuget-${{ runner.os }}- - run: make lint build: @@ -32,6 +42,12 @@ jobs: - uses: https://github.com/actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' + - uses: https://github.com/actions/cache@v3 + with: + path: ~/.nuget/packages + key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} + restore-keys: | + nuget-${{ runner.os }}- - run: make build unit: @@ -41,6 +57,12 @@ jobs: - uses: https://github.com/actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' + - uses: https://github.com/actions/cache@v3 + with: + path: ~/.nuget/packages + key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} + restore-keys: | + nuget-${{ runner.os }}- - run: make unit # Frontend (Nx/Angular) lane: install with pnpm, then Nx lint + test + build. @@ -64,6 +86,12 @@ jobs: - uses: https://github.com/actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' + - uses: https://github.com/actions/cache@v3 + with: + path: ~/.nuget/packages + key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} + restore-keys: | + nuget-${{ runner.os }}- - run: make mutation # Publish the Stryker HTML reports. `if: always()` uploads them even when the # ratchet fails — that is exactly when you want to inspect the survivors.