diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3071ac1..1fde5bf 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -99,10 +99,10 @@ jobs: # shell: bash # run: | # echo "DOTNET_INSTALL_DIR=$LocalAppData\Microsoft\dotnet2" >> $GITHUB_ENV - # 2.0, 3.0, 5.0 needs to be in single quotes to interpret as a string instead of as an integer - name: Clear installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + # 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 '3.1' uses: ./ with: @@ -115,23 +115,32 @@ jobs: run: __tests__/verify-dotnet.ps1 3.1 # Clear cache before .x version install - - name: Set new tool cache (macOS) - if: runner.os == 'macos' - run: | - echo "DOTNET_INSTALL_DIR=/Users/runner/.dotnet3" >> $GITHUB_ENV - - name: Set new tool cache (Ubuntu) - if: runner.os == 'linux' - run: | - echo "DOTNET_INSTALL_DIR=/home/runner/.dotnet3" >> $GITHUB_ENV - - name: Set new tool cache (Windows) - if: runner.os == 'windows' - shell: bash - run: | - echo "DOTNET_INSTALL_DIR=$LocalAppData\Microsoft\dotnet3" >> $GITHUB_ENV - - name: Setup dotnet 2.0.x + # - name: Set new tool cache (macOS) + # if: runner.os == 'macos' + # run: | + # echo "DOTNET_INSTALL_DIR=/Users/runner/.dotnet3" >> $GITHUB_ENV + # - name: Set new tool cache (Ubuntu) + # if: runner.os == 'linux' + # run: | + # echo "DOTNET_INSTALL_DIR=/home/runner/.dotnet3" >> $GITHUB_ENV + # - name: Set new tool cache (Windows) + # if: runner.os == 'windows' + # shell: bash + # run: | + # echo "DOTNET_INSTALL_DIR=$LocalAppData\Microsoft\dotnet3" >> $GITHUB_ENV + - name: Clear installed dotnet versions + shell: pwsh + run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + - name: Setup dotnet 3.1.x uses: ./ with: - dotnet-version: 2.0.x + dotnet-version: 3.1.x + - name: Verify dotnet + if: runner.os != 'windows' + run: __tests__/verify-dotnet.sh 3.1 + - name: Verify dotnet (Windows) + if: runner.os == 'windows' + run: __tests__/verify-dotnet.ps1 3.1 # Clear cache before .* version install - name: Set new tool cache (macOS) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index 2cbfc1d..a3ed7b7 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -24,4 +24,8 @@ foreach ($path in $pathsToClear) { } } -dotnet --info \ No newline at end of file +try { + dotnet --info +} catch { + Write-Host "Dotnet was removed successfully" +} \ No newline at end of file