From 3a268dcaf18d7780c21bbf140ec6611d78a86f6f Mon Sep 17 00:00:00 2001 From: fristyxd Date: Sat, 5 Sep 2026 14:31:49 +0300 Subject: [PATCH] ci: add dotnet tools caching to speed up tool restore (was 32 min) --- .gitea/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d33315c..cfad238 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -41,11 +41,22 @@ jobs: restore-keys: | nuget-${{ runner.os }}- + - name: Cache dotnet tools + id: tools-cache + uses: actions/cache@v3 + continue-on-error: true + with: + path: ${{ runner.temp }}/.dotnet/tools + key: tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }} + restore-keys: | + tools-${{ runner.os }}- + - name: Cache status if: always() shell: powershell run: | Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" + Write-Host "Tools cache hit: ${{ steps.tools-cache.outputs.cache-hit }}" - name: Restore tools shell: powershell @@ -87,11 +98,22 @@ jobs: restore-keys: | nuget-${{ runner.os }}- + - name: Cache dotnet tools + id: tools-cache + uses: actions/cache@v3 + continue-on-error: true + with: + path: ${{ runner.temp }}/.dotnet/tools + key: tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }} + restore-keys: | + tools-${{ runner.os }}- + - name: Cache status if: always() shell: powershell run: | Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" + Write-Host "Tools cache hit: ${{ steps.tools-cache.outputs.cache-hit }}" - name: Run tests (if any test projects exist) shell: powershell @@ -140,11 +162,22 @@ jobs: restore-keys: | nuget-${{ runner.os }}- + - name: Cache dotnet tools + id: tools-cache + uses: actions/cache@v3 + continue-on-error: true + with: + path: ${{ runner.temp }}/.dotnet/tools + key: tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }} + restore-keys: | + tools-${{ runner.os }}- + - name: Cache status if: always() shell: powershell run: | Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" + Write-Host "Tools cache hit: ${{ steps.tools-cache.outputs.cache-hit }}" - name: Restore tools shell: powershell