From 76a91b1af89ac6842ab4d19d68a4f21637a4ab82 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:10:28 +0300 Subject: [PATCH] Debug --- .github/workflows/workflow.yml | 82 ++++++--------------------- __tests__/clear-installed-dotnet.ps1 | 6 +- __tests__/sample-csproj/sample.csproj | 2 +- 3 files changed, 18 insertions(+), 72 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1fde5bf..e2c4aa7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,25 +46,6 @@ jobs: - name: Clear installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} - # - name: Clear tool cache (macOS) - # if: runner.os == 'macos' - # run: | - # echo $PATH - # dotnet --info - # rm -rf "/Users/runner/.dotnet" - # - name: Clear tool cache (Ubuntu) - # if: runner.os == 'linux' - # run: | - # echo $PATH - # dotnet --info - # rm -rf "/usr/share/dotnet" - # - name: Clear tool cache (Windows) - # if: runner.os == 'windows' - # run: | - # echo $env:PATH - # dotnet --info - # Remove-Item $env:LocalAppData\Microsoft\dotnet/* -Recurse -Force -ErrorAction SilentlyContinue - # Remove-Item "$env:ProgramFiles\dotnet/*" -Recurse -Force -ErrorAction SilentlyContinue # Side-by-side install of 2.2 and 3.1 used for the test project - name: Setup dotnet 2.2.402 uses: ./ @@ -85,24 +66,10 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 - # Set new cache before 2 digit install - # - name: Set new tool cache (macOS) - # if: runner.os == 'macos' - # run: | - # echo "DOTNET_INSTALL_DIR=/Users/runner/.dotnet2" >> $GITHUB_ENV - # - name: Set new tool cache (Ubuntu) - # if: runner.os == 'linux' - # run: | - # echo "DOTNET_INSTALL_DIR=/home/runner/.dotnet2" >> $GITHUB_ENV - # - name: Set new tool cache (Windows) - # if: runner.os == 'windows' - # 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: @@ -113,21 +80,8 @@ jobs: - name: Verify dotnet (Windows) if: runner.os == 'windows' 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 + + # Dotnet .x version install - name: Clear installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} @@ -142,25 +96,21 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1 - # Clear cache before .* version install - - name: Set new tool cache (macOS) - if: runner.os == 'macos' - run: | - echo "DOTNET_INSTALL_DIR=/Users/runner/.dotnet4" >> $GITHUB_ENV - - name: Set new tool cache (Ubuntu) - if: runner.os == 'linux' - run: | - echo "DOTNET_INSTALL_DIR=/home/runner/.dotnet4" >> $GITHUB_ENV - - name: Set new tool cache (Windows) - if: runner.os == 'windows' - shell: bash - run: | - echo "DOTNET_INSTALL_DIR=$LocalAppData\Microsoft\dotnet4" >> $GITHUB_ENV - - name: Setup dotnet 2.0.* + # Dotnet .* version install + - name: Clear installed dotnet versions + shell: pwsh + run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + - name: Setup dotnet 5.0.* uses: ./ with: - dotnet-version: 2.0.* - + dotnet-version: 5.0.* + - name: Verify dotnet + if: runner.os != 'windows' + run: __tests__/verify-dotnet.sh 5.0 + - name: Verify dotnet (Windows) + if: runner.os == 'windows' + run: __tests__/verify-dotnet.ps1 5.0 + test-proxy: runs-on: ubuntu-latest container: diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index a3ed7b7..ba87760 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -24,8 +24,4 @@ foreach ($path in $pathsToClear) { } } -try { - dotnet --info -} catch { - Write-Host "Dotnet was removed successfully" -} \ No newline at end of file +Get-Command "dotnet --info" \ No newline at end of file diff --git a/__tests__/sample-csproj/sample.csproj b/__tests__/sample-csproj/sample.csproj index 50fb5e4..14942f9 100644 --- a/__tests__/sample-csproj/sample.csproj +++ b/__tests__/sample-csproj/sample.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;netcoreapp2.2 + netcoreapp3.1;netcoreapp2.2;netcoreapp5.0 sample_csproj false