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: |
|
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
|
||||||
|
|||||||
Reference in new issue
Block a user