From 8958a19445c9418d9aaccb3575b60ffa4f385ae0 Mon Sep 17 00:00:00 2001 From: Zachary Eisinger Date: Wed, 23 Sep 2020 14:15:49 -0700 Subject: [PATCH] Set new cache location for installing --- .github/workflows/workflow.yml | 53 ++++++++++++---------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fbc0511..022b034 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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: