ci: add dotnet tools caching to speed up tool restore (was 32 min)
This commit is contained in:
1 file changed
+33
@@ -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
|
||||
|
||||
Reference in new issue
Block a user