Set new cache location for installing

This commit is contained in:
Zachary Eisinger 2020-09-23 14:15:49 -07:00
parent 202c2d68fc
commit 8958a19445

View File

@ -77,24 +77,19 @@ jobs:
if: runner.os == 'windows' if: runner.os == 'windows'
run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402
# Clear cache before 2 digit install # Set new cache before 2 digit install
- name: Clear tool cache (macOS) - name: Set new tool cache (macOS)
if: runner.os == 'macos' if: runner.os == 'macos'
run: | run: |
rm -rf "/Users/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet2"
- name: Clear tool cache (Ubuntu) - name: Set new tool cache (Ubuntu)
if: runner.os == 'linux' if: runner.os == 'linux'
run: | run: |
rm -rf "/home/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet2"
- name: Clear tool cache (Windows) - name: Set new tool cache (Windows)
if: runner.os == 'windows' if: runner.os == 'windows'
run: | run: |
$SleepTime = 0 echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet2"
while ((Test-Path $env:LocalAppData\Microsoft\dotnet) -and ($SleepTime -lt 120)) {
Start-Sleep $SleepTime
Remove-Item $env:LocalAppData\Microsoft\dotnet/* -Recurse -Force -ErrorAction SilentlyContinue
$SleepTime += 5
}
# 2.0, 3.0, 5.0 needs to be in single quotes to interpret as a string instead of as an integer # 2.0, 3.0, 5.0 needs to be in single quotes to interpret as a string instead of as an integer
- name: Setup dotnet '2.0' - name: Setup dotnet '2.0'
uses: ./ uses: ./
@ -102,46 +97,36 @@ jobs:
dotnet-version: '2.0' dotnet-version: '2.0'
# Clear cache before .x version install # Clear cache before .x version install
- name: Clear tool cache (macOS) - name: Set new tool cache (macOS)
if: runner.os == 'macos' if: runner.os == 'macos'
run: | run: |
rm -rf "/Users/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet3"
- name: Clear tool cache (Ubuntu) - name: Set new tool cache (Ubuntu)
if: runner.os == 'linux' if: runner.os == 'linux'
run: | run: |
rm -rf "/home/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet3"
- name: Clear tool cache (Windows) - name: Set new tool cache (Windows)
if: runner.os == 'windows' if: runner.os == 'windows'
run: | run: |
$SleepTime = 0 echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet3"
while ((Test-Path $env:LocalAppData\Microsoft\dotnet) -and ($SleepTime -lt 120)) {
Start-Sleep $SleepTime
Remove-Item $env:LocalAppData\Microsoft\dotnet/* -Recurse -Force -ErrorAction SilentlyContinue
$SleepTime += 5
}
- name: Setup dotnet 2.0.x - name: Setup dotnet 2.0.x
uses: ./ uses: ./
with: with:
dotnet-version: 2.0.x dotnet-version: 2.0.x
# Clear cache before .* version install # Clear cache before .* version install
- name: Clear tool cache (macOS) - name: Set new tool cache (macOS)
if: runner.os == 'macos' if: runner.os == 'macos'
run: | run: |
rm -rf "/Users/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet4"
- name: Clear tool cache (Ubuntu) - name: Set new tool cache (Ubuntu)
if: runner.os == 'linux' if: runner.os == 'linux'
run: | run: |
rm -rf "/home/runner/.dotnet" echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet4"
- name: Clear tool cache (Windows) - name: Set new tool cache (Windows)
if: runner.os == 'windows' if: runner.os == 'windows'
run: | run: |
$SleepTime = 0 echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet4"
while ((Test-Path $env:LocalAppData\Microsoft\dotnet) -and ($SleepTime -lt 120)) {
Start-Sleep $SleepTime
Remove-Item $env:LocalAppData\Microsoft\dotnet/* -Recurse -Force -ErrorAction SilentlyContinue
$SleepTime += 5
}
- name: Setup dotnet 2.0.* - name: Setup dotnet 2.0.*
uses: ./ uses: ./
with: with: