ci: add dotnet tools caching to speed up tool restore (was 32 min)
CI / test (push) Successful in 55s
CI / release (push) Canceled after 0s
CI / build (push) Canceled after 2m33s

This commit is contained in:
fristy committed 2026-09-05 14:31:49 +03:00
1 parent 2de313c966
commit 3a268dcaf1
1 file changed
+33
+33
View File
@@ -41,11 +41,22 @@ jobs:
restore-keys: | restore-keys: |
nuget-${{ runner.os }}- 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 - name: Cache status
if: always() if: always()
shell: powershell shell: powershell
run: | run: |
Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" 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 - name: Restore tools
shell: powershell shell: powershell
@@ -87,11 +98,22 @@ jobs:
restore-keys: | restore-keys: |
nuget-${{ runner.os }}- 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 - name: Cache status
if: always() if: always()
shell: powershell shell: powershell
run: | run: |
Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" 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) - name: Run tests (if any test projects exist)
shell: powershell shell: powershell
@@ -140,11 +162,22 @@ jobs:
restore-keys: | restore-keys: |
nuget-${{ runner.os }}- 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 - name: Cache status
if: always() if: always()
shell: powershell shell: powershell
run: | run: |
Write-Host "NuGet cache hit: ${{ steps.nuget-cache.outputs.cache-hit }}" 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 - name: Restore tools
shell: powershell shell: powershell