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'
run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402
# Clear cache before 2 digit install
- name: Clear tool cache (macOS)
# Set new cache before 2 digit install
- name: Set new tool cache (macOS)
if: runner.os == 'macos'
run: |
rm -rf "/Users/runner/.dotnet"
- name: Clear tool cache (Ubuntu)
echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet2"
- name: Set new tool cache (Ubuntu)
if: runner.os == 'linux'
run: |
rm -rf "/home/runner/.dotnet"
- name: Clear tool cache (Windows)
echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet2"
- name: Set new tool cache (Windows)
if: runner.os == 'windows'
run: |
$SleepTime = 0
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
}
echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet2"
# 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'
uses: ./
@ -102,46 +97,36 @@ jobs:
dotnet-version: '2.0'
# Clear cache before .x version install
- name: Clear tool cache (macOS)
- name: Set new tool cache (macOS)
if: runner.os == 'macos'
run: |
rm -rf "/Users/runner/.dotnet"
- name: Clear tool cache (Ubuntu)
echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet3"
- name: Set new tool cache (Ubuntu)
if: runner.os == 'linux'
run: |
rm -rf "/home/runner/.dotnet"
- name: Clear tool cache (Windows)
echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet3"
- name: Set new tool cache (Windows)
if: runner.os == 'windows'
run: |
$SleepTime = 0
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
}
echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet3"
- name: Setup dotnet 2.0.x
uses: ./
with:
dotnet-version: 2.0.x
# Clear cache before .* version install
- name: Clear tool cache (macOS)
- name: Set new tool cache (macOS)
if: runner.os == 'macos'
run: |
rm -rf "/Users/runner/.dotnet"
- name: Clear tool cache (Ubuntu)
echo "::set-env name=DOTNET_INSTALL_DIR::/Users/runner/.dotnet4"
- name: Set new tool cache (Ubuntu)
if: runner.os == 'linux'
run: |
rm -rf "/home/runner/.dotnet"
- name: Clear tool cache (Windows)
echo "::set-env name=DOTNET_INSTALL_DIR::/home/runner/.dotnet4"
- name: Set new tool cache (Windows)
if: runner.os == 'windows'
run: |
$SleepTime = 0
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
}
echo "::set-env name=DOTNET_INSTALL_DIR::$env:LocalAppData\Microsoft\dotnet4"
- name: Setup dotnet 2.0.*
uses: ./
with: