From 975b958e4cac99617e2cd60ca576b214646f38b7 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 10:59:17 +0300 Subject: [PATCH 01/62] Debug --- .github/workflows/workflow.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c88f4b8..5d0b059 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,11 +1,16 @@ name: Main workflow on: + workflow_dispatch: pull_request: + paths-ignore: + - '**.md' push: branches: - main - releases/* + paths-ignore: + - '**.md' jobs: build: @@ -13,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] + operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 @@ -34,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] + operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 From 62230c54093f00c23723ac3f8560755337dc4a89 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 14:37:15 +0300 Subject: [PATCH 02/62] Move toolcache cleanup to separated script --- .github/workflows/workflow.yml | 4 ++++ __tests__/clear-toolcache.ps1 | 1 + 2 files changed, 5 insertions(+) create mode 100644 __tests__/clear-toolcache.ps1 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5d0b059..747ab3b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -43,6 +43,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Clear toolcache + shell: pwsh + run: __tests__/clear-toolcache.ps1 runner.os + - name: Clear tool cache (macOS) if: runner.os == 'macos' run: | diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 new file mode 100644 index 0000000..d8bb85b --- /dev/null +++ b/__tests__/clear-toolcache.ps1 @@ -0,0 +1 @@ +Write-Host $args[0] \ No newline at end of file From 8ada5b555885a4e9bbb816a66c2b781ad26388be Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 14:42:33 +0300 Subject: [PATCH 03/62] Debug --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 747ab3b..ef5814d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v2 - name: Clear toolcache shell: pwsh - run: __tests__/clear-toolcache.ps1 runner.os + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} - name: Clear tool cache (macOS) if: runner.os == 'macos' From 7261940ea52b994caa423e53f7e8c1f01525292c Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 14:56:08 +0300 Subject: [PATCH 04/62] Debug --- __tests__/clear-toolcache.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index d8bb85b..1e332c7 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -1 +1,4 @@ -Write-Host $args[0] \ No newline at end of file +Write-Host $args[0] + +Write-Host $env:PATH +dotnet --info \ No newline at end of file From a3d47e556cc06347e059f4db4672c7a8dce29e8b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:13:32 +0300 Subject: [PATCH 05/62] Debug --- __tests__/clear-toolcache.ps1 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 1e332c7..1e702c5 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -1,4 +1,26 @@ Write-Host $args[0] -Write-Host $env:PATH +$os = $args[0] + +$linuxDotnetPaths = @("/usr/share/dotnet") +$macOSDotnetPaths = @("/Users/runner/.dotnet") +$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFiles\dotnet/*") + +$pathsToClear = @() + +if ($os == "linux") { + $pathsToClear = $linuxDotnetPaths +} elseif ($os == "macOS") { + $pathsToClear = $macOSDotnetPaths +} elseif ($os == "windows") { + $pathsToClear = $windowsDotnetPaths +} + +foreach ($path in $pathsToClear) { + if (Test-Path $path) { + Write-Host "Clear $path" + Remove-Item $path -Recurse -Force + } +} + dotnet --info \ No newline at end of file From 843b5197ce500bb7b7e8def544aa80759efad358 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:15:56 +0300 Subject: [PATCH 06/62] Debug --- __tests__/clear-toolcache.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 1e702c5..2f1c2e4 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -8,11 +8,11 @@ $windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFil $pathsToClear = @() -if ($os == "linux") { +if ($os -eq "linux") { $pathsToClear = $linuxDotnetPaths -} elseif ($os == "macOS") { +} elseif ($os -eq "macOS") { $pathsToClear = $macOSDotnetPaths -} elseif ($os == "windows") { +} elseif ($os -eq "windows") { $pathsToClear = $windowsDotnetPaths } From 6ade6c061b6b70bcf9e57331956f91ed08e107f7 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:17:48 +0300 Subject: [PATCH 07/62] Minor fix --- __tests__/clear-toolcache.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 2f1c2e4..0867ae5 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -8,11 +8,11 @@ $windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFil $pathsToClear = @() -if ($os -eq "linux") { +if ($os -eq "Linux") { $pathsToClear = $linuxDotnetPaths } elseif ($os -eq "macOS") { $pathsToClear = $macOSDotnetPaths -} elseif ($os -eq "windows") { +} elseif ($os -eq "Windows") { $pathsToClear = $windowsDotnetPaths } From c8cf369c29600fcd2b28a2bf8f347661e971a568 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:20:22 +0300 Subject: [PATCH 08/62] Debug --- .github/workflows/workflow.yml | 39 +++++++++++++++++----------------- __tests__/clear-toolcache.ps1 | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ef5814d..35a8336 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,26 +46,25 @@ jobs: - name: Clear toolcache shell: pwsh run: __tests__/clear-toolcache.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 + # - 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: ./ diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 0867ae5..e76ed28 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -18,7 +18,7 @@ if ($os -eq "Linux") { foreach ($path in $pathsToClear) { if (Test-Path $path) { - Write-Host "Clear $path" + Write-Host "Clear $path path" Remove-Item $path -Recurse -Force } } From 7669e56997538516b130e5236ae34381e3e8a578 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:31:11 +0300 Subject: [PATCH 09/62] Debug --- __tests__/clear-toolcache.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index e76ed28..82a9629 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -2,9 +2,11 @@ Write-Host $args[0] $os = $args[0] -$linuxDotnetPaths = @("/usr/share/dotnet") -$macOSDotnetPaths = @("/Users/runner/.dotnet") -$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFiles\dotnet/*") +$linuxDotnetPaths = @("/usr/share/dotnet", "$env:HOME/.dotnet") +$macOSDotnetPaths = @("$env:HOME/.dotnet") +$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", + "$env:ProgramFiles\dotnet/*", + "$env:HOME\.dotnet") $pathsToClear = @() @@ -13,6 +15,7 @@ if ($os -eq "Linux") { } elseif ($os -eq "macOS") { $pathsToClear = $macOSDotnetPaths } elseif ($os -eq "Windows") { + Write-Host $env:LocalAppData $pathsToClear = $windowsDotnetPaths } From 71f0d4bd0729544314c568e7c876323fc7a64d70 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:34:01 +0300 Subject: [PATCH 10/62] Debug --- .github/workflows/workflow.yml | 2 +- __tests__/{clear-toolcache.ps1 => clear-installed-dotnet.ps1} | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) rename __tests__/{clear-toolcache.ps1 => clear-installed-dotnet.ps1} (95%) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 35a8336..4cede84 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v2 - name: Clear toolcache shell: pwsh - run: __tests__/clear-toolcache.ps1 ${{ runner.os }} + run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} # - name: Clear tool cache (macOS) # if: runner.os == 'macos' # run: | diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-installed-dotnet.ps1 similarity index 95% rename from __tests__/clear-toolcache.ps1 rename to __tests__/clear-installed-dotnet.ps1 index 82a9629..2cbfc1d 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -1,5 +1,3 @@ -Write-Host $args[0] - $os = $args[0] $linuxDotnetPaths = @("/usr/share/dotnet", "$env:HOME/.dotnet") From 10ad86dc121b35065e21d69c5f4dee955742b263 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:40:37 +0300 Subject: [PATCH 11/62] Debug --- .github/workflows/workflow.yml | 41 +++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4cede84..3071ac1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Clear toolcache + - name: Clear installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} # - name: Clear tool cache (macOS) @@ -86,24 +86,33 @@ jobs: 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 + # - 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: Setup dotnet '2.0' + - name: Clear installed dotnet versions + shell: pwsh + run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + - name: Setup dotnet '3.1' uses: ./ with: - dotnet-version: '2.0' + dotnet-version: '3.1' + - 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 .x version install - name: Set new tool cache (macOS) From 9d49fb8e98b8556448469903a56cad9b47180e33 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:54:50 +0300 Subject: [PATCH 12/62] Debug --- .github/workflows/workflow.yml | 41 +++++++++++++++++----------- __tests__/clear-installed-dotnet.ps1 | 6 +++- 2 files changed, 30 insertions(+), 17 deletions(-) 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 From 76a91b1af89ac6842ab4d19d68a4f21637a4ab82 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:10:28 +0300 Subject: [PATCH 13/62] 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 From 347456b93444d3066252c43b8e28e297d6d36979 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:15:36 +0300 Subject: [PATCH 14/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index ba87760..84ad0d8 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -24,4 +24,10 @@ foreach ($path in $pathsToClear) { } } -Get-Command "dotnet --info" \ No newline at end of file +try { + Get-Command "dotnet --info" + Write-Host "dotnet was not removed" + exit 1 +} catch { + Write-Host "dotnet was removed successfully" +} \ No newline at end of file From d33a835564b9365331eda335eae3d86b5604423e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:18:47 +0300 Subject: [PATCH 15/62] Debug --- .github/workflows/workflow.yml | 10 +++++----- __tests__/sample-csproj/sample.csproj | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e2c4aa7..d147902 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -100,17 +100,17 @@ jobs: - name: Clear installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} - - name: Setup dotnet 5.0.* + - name: Setup dotnet 3.1.* uses: ./ with: - dotnet-version: 5.0.* + dotnet-version: 3.1.* - name: Verify dotnet if: runner.os != 'windows' - run: __tests__/verify-dotnet.sh 5.0 + run: __tests__/verify-dotnet.sh 3.1 - name: Verify dotnet (Windows) if: runner.os == 'windows' - run: __tests__/verify-dotnet.ps1 5.0 - + run: __tests__/verify-dotnet.ps1 3.1 + test-proxy: runs-on: ubuntu-latest container: diff --git a/__tests__/sample-csproj/sample.csproj b/__tests__/sample-csproj/sample.csproj index 14942f9..50fb5e4 100644 --- a/__tests__/sample-csproj/sample.csproj +++ b/__tests__/sample-csproj/sample.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;netcoreapp2.2;netcoreapp5.0 + netcoreapp3.1;netcoreapp2.2 sample_csproj false From 45c0959fcd4e047c42b807e38dd2d3d0bc3cccf2 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:24:26 +0300 Subject: [PATCH 16/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index 84ad0d8..7dcbfa7 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -20,7 +20,7 @@ if ($os -eq "Linux") { foreach ($path in $pathsToClear) { if (Test-Path $path) { Write-Host "Clear $path path" - Remove-Item $path -Recurse -Force + # Remove-Item $path -Recurse -Force } } From 53b5bae1f66156ef9945f7f584dbacc73e1d8bd9 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:32:31 +0300 Subject: [PATCH 17/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index 7dcbfa7..c92e0a2 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -20,14 +20,6 @@ if ($os -eq "Linux") { foreach ($path in $pathsToClear) { if (Test-Path $path) { Write-Host "Clear $path path" - # Remove-Item $path -Recurse -Force + Remove-Item $path -Recurse -Force } } - -try { - Get-Command "dotnet --info" - Write-Host "dotnet was not removed" - exit 1 -} catch { - Write-Host "dotnet was removed successfully" -} \ No newline at end of file From 2d640ec7395ad882db7e951d206aeff4630d07fc Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:47:26 +0300 Subject: [PATCH 18/62] Debug --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d147902..b6e2394 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Clear installed dotnet versions + - name: Remove installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} # Side-by-side install of 2.2 and 3.1 used for the test project @@ -67,7 +67,7 @@ jobs: run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 # 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 + - name: Remove installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} - name: Setup dotnet '3.1' @@ -82,7 +82,7 @@ jobs: run: __tests__/verify-dotnet.ps1 3.1 # Dotnet .x version install - - name: Clear installed dotnet versions + - name: Remove installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} - name: Setup dotnet 3.1.x @@ -97,7 +97,7 @@ jobs: run: __tests__/verify-dotnet.ps1 3.1 # Dotnet .* version install - - name: Clear installed dotnet versions + - name: Remove installed dotnet versions shell: pwsh run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} - name: Setup dotnet 3.1.* From 8807004b2045de0e18528bd42bde96456cfdbf7f Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 16:54:18 +0300 Subject: [PATCH 19/62] Minor fix --- __tests__/clear-installed-dotnet.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index c92e0a2..c2e6015 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -13,7 +13,6 @@ if ($os -eq "Linux") { } elseif ($os -eq "macOS") { $pathsToClear = $macOSDotnetPaths } elseif ($os -eq "Windows") { - Write-Host $env:LocalAppData $pathsToClear = $windowsDotnetPaths } From c7eaa2ec00401d4e4141323fdb495b18c50a42be Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 17:03:23 +0300 Subject: [PATCH 20/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index c2e6015..53776e8 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -2,9 +2,9 @@ $os = $args[0] $linuxDotnetPaths = @("/usr/share/dotnet", "$env:HOME/.dotnet") $macOSDotnetPaths = @("$env:HOME/.dotnet") -$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", +$windowsDotnetPaths = @("$env:HOME\.dotnet", "$env:ProgramFiles\dotnet/*", - "$env:HOME\.dotnet") + "$env:LocalAppData\Microsoft\dotnet/*") $pathsToClear = @() From 6b7d95197756815582cc2dd787c0004b279d3781 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 17:13:32 +0300 Subject: [PATCH 21/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index 53776e8..4e90e7b 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -19,6 +19,6 @@ if ($os -eq "Linux") { foreach ($path in $pathsToClear) { if (Test-Path $path) { Write-Host "Clear $path path" - Remove-Item $path -Recurse -Force + Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue } } From 7bbfec324fdab68e98a08aa4f021b3b29d4a7e61 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 17:46:39 +0300 Subject: [PATCH 22/62] Debug --- __tests__/clear-installed-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-installed-dotnet.ps1 index 4e90e7b..53776e8 100644 --- a/__tests__/clear-installed-dotnet.ps1 +++ b/__tests__/clear-installed-dotnet.ps1 @@ -19,6 +19,6 @@ if ($os -eq "Linux") { foreach ($path in $pathsToClear) { if (Test-Path $path) { Write-Host "Clear $path path" - Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item $path -Recurse -Force } } From c8cb48ba8bfca8d6c1fc4503ac3b4c7c5219ab15 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:19:10 +0300 Subject: [PATCH 23/62] Debug --- .github/workflows/workflow.yml | 47 +++++++++++++++---- ...stalled-dotnet.ps1 => clear-toolcache.ps1} | 0 2 files changed, 37 insertions(+), 10 deletions(-) rename __tests__/{clear-installed-dotnet.ps1 => clear-toolcache.ps1} (100%) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b6e2394..809b3db 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -43,9 +43,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Remove installed dotnet versions + - name: Clear toolcache shell: pwsh - run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} # Side-by-side install of 2.2 and 3.1 used for the test project - name: Setup dotnet 2.2.402 uses: ./ @@ -66,10 +66,19 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 - # 2.0, 3.0, 5.0 needs to be in single quotes to interpret as a string instead of as an integer - - name: Remove installed dotnet versions + test-v2: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Clear toolcache shell: pwsh - run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + run: __tests__/clear-toolcache.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: @@ -80,11 +89,20 @@ jobs: - name: Verify dotnet (Windows) if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1 - + + test-v3: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 # Dotnet .x version install - - name: Remove installed dotnet versions + - name: Clear toolcache shell: pwsh - run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} - name: Setup dotnet 3.1.x uses: ./ with: @@ -96,10 +114,19 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1 + test-v4: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 # Dotnet .* version install - - name: Remove installed dotnet versions + - name: Clear toolcache shell: pwsh - run: __tests__/clear-installed-dotnet.ps1 ${{ runner.os }} + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} - name: Setup dotnet 3.1.* uses: ./ with: diff --git a/__tests__/clear-installed-dotnet.ps1 b/__tests__/clear-toolcache.ps1 similarity index 100% rename from __tests__/clear-installed-dotnet.ps1 rename to __tests__/clear-toolcache.ps1 From 131ac602dcc3eaf773701ae896f6b2ef7f00ec85 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:22:50 +0300 Subject: [PATCH 24/62] Debug --- .github/workflows/workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 809b3db..62144c5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -83,6 +83,7 @@ jobs: uses: ./ with: dotnet-version: '3.1' + source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 @@ -107,6 +108,7 @@ jobs: uses: ./ with: dotnet-version: 3.1.x + source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 @@ -131,6 +133,7 @@ jobs: uses: ./ with: dotnet-version: 3.1.* + source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 From a1105722ad2e863b8d7fb5d4865711ba2a3a30bd Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:27:28 +0300 Subject: [PATCH 25/62] Debug --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 62144c5..497f1bf 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,7 +34,7 @@ jobs: if: runner.os != 'windows' run: __tests__/verify-no-unstaged-changes.sh - test: + test-setup-full-version: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false @@ -66,7 +66,7 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 - test-v2: + test-setup-without-patch-version: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false @@ -91,7 +91,7 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1 - test-v3: + test-setup-x-patch-version: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false @@ -116,7 +116,7 @@ jobs: if: runner.os == 'windows' run: __tests__/verify-dotnet.ps1 3.1 - test-v4: + test-setup-with-wildcard: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false From 79735df611b9d310c7adc9eb96f0d766509bd79e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:31:18 +0300 Subject: [PATCH 26/62] Debug --- .github/workflows/workflow.yml | 2 -- __tests__/clear-toolcache.ps1 | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 497f1bf..6f1b61f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -100,7 +100,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Dotnet .x version install - name: Clear toolcache shell: pwsh run: __tests__/clear-toolcache.ps1 ${{ runner.os }} @@ -125,7 +124,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - # Dotnet .* version install - name: Clear toolcache shell: pwsh run: __tests__/clear-toolcache.ps1 ${{ runner.os }} diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 53776e8..60f630c 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -1,9 +1,8 @@ $os = $args[0] -$linuxDotnetPaths = @("/usr/share/dotnet", "$env:HOME/.dotnet") +$linuxDotnetPaths = @("/usr/share/dotnet") $macOSDotnetPaths = @("$env:HOME/.dotnet") -$windowsDotnetPaths = @("$env:HOME\.dotnet", - "$env:ProgramFiles\dotnet/*", +$windowsDotnetPaths = @("$env:ProgramFiles\dotnet/*", "$env:LocalAppData\Microsoft\dotnet/*") $pathsToClear = @() From 5dcd27b0bca29a029eba2f8d49ee304173b4df6c Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:34:53 +0300 Subject: [PATCH 27/62] Add nuget config file --- __tests__/sample-csproj/nuget.config | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 __tests__/sample-csproj/nuget.config diff --git a/__tests__/sample-csproj/nuget.config b/__tests__/sample-csproj/nuget.config new file mode 100644 index 0000000..bf0c027 --- /dev/null +++ b/__tests__/sample-csproj/nuget.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From a0f70ab98c4630730d90c6b74e6e10acda96cfc5 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:38:45 +0300 Subject: [PATCH 28/62] Debug --- .github/workflows/workflow.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6f1b61f..4aef239 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -83,7 +83,6 @@ jobs: uses: ./ with: dotnet-version: '3.1' - source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 @@ -107,7 +106,6 @@ jobs: uses: ./ with: dotnet-version: 3.1.x - source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 @@ -131,7 +129,6 @@ jobs: uses: ./ with: dotnet-version: 3.1.* - source-url: https://api.nuget.org/v3/index.json - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1 From 5c5ac76dc6fadc8620f389b82e8325fefd95b9ae Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:43:21 +0300 Subject: [PATCH 29/62] Debug --- __tests__/verify-dotnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index 098d076..b8f9492 100755 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -3,10 +3,10 @@ if [ -z "$1" ]; then exit 1 fi -if [ ! -f "../nuget.config" ]; then - echo "nuget file not generated correctly" - exit 1 -fi +# if [ ! -f "../nuget.config" ]; then +# echo "nuget file not generated correctly" +# exit 1 +# fi dotnet_version="$(dotnet --version)" echo "Found dotnet version '$dotnet_version'" From 059f1aa99bb356fcf96be16c36994328d6294967 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 09:57:09 +0300 Subject: [PATCH 30/62] Debug --- .github/workflows/workflow.yml | 4 ++++ __tests__/sample-csproj/nuget.config | 6 ------ __tests__/verify-dotnet.ps1 | 5 ----- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 __tests__/sample-csproj/nuget.config diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4aef239..6f8ef44 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -59,6 +59,10 @@ jobs: source-url: https://api.nuget.org/v3/index.json env: NUGET_AUTH_TOKEN: NOTATOKEN + - name: Verify nuget config file + shell: pwsh + run: | + if (-Not (Test-Path "./nuget.config")) { throw "nuget file not generated correctly" } - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1.201 2.2.402 diff --git a/__tests__/sample-csproj/nuget.config b/__tests__/sample-csproj/nuget.config deleted file mode 100644 index bf0c027..0000000 --- a/__tests__/sample-csproj/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 6af4297..b253807 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -3,11 +3,6 @@ if (!$args[0]) throw "Must supply dotnet version argument" } -if (-Not (Test-Path "../nuget.config")) -{ - throw "nuget file not generated correctly" -} - $dotnet = Get-Command dotnet | Select-Object -First 1 | ForEach-Object { $_.Path } Write-Host "Found '$dotnet'" From 24ed2d0102c6142b845e4c83ba8c051615c1a177 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 10:06:12 +0300 Subject: [PATCH 31/62] Debug --- .github/workflows/workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6f8ef44..0410ea0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -62,7 +62,8 @@ jobs: - name: Verify nuget config file shell: pwsh run: | - if (-Not (Test-Path "./nuget.config")) { throw "nuget file not generated correctly" } + Get-ChildItem . + # if (-Not (Test-Path "./nuget.config")) { throw "nuget file not generated correctly" } - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1.201 2.2.402 From bb2233aaa552973cd6f9261b3978bf4e88f906c1 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 10:17:46 +0300 Subject: [PATCH 32/62] Debug --- __tests__/verify-dotnet.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index b253807..f0b685f 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -3,6 +3,8 @@ if (!$args[0]) throw "Must supply dotnet version argument" } +Get-ChildItem . + $dotnet = Get-Command dotnet | Select-Object -First 1 | ForEach-Object { $_.Path } Write-Host "Found '$dotnet'" From 831e0d4070905540fe6546765244af68aa64a60e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 10:36:14 +0300 Subject: [PATCH 33/62] Debug --- .github/workflows/workflow.yml | 3 +-- __tests__/verify-dotnet.ps1 | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0410ea0..09340a9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -62,8 +62,7 @@ jobs: - name: Verify nuget config file shell: pwsh run: | - Get-ChildItem . - # if (-Not (Test-Path "./nuget.config")) { throw "nuget file not generated correctly" } + if (-Not (Test-Path "../nuget.config")) { throw "nuget file not generated correctly" } - name: Verify dotnet if: runner.os != 'windows' run: __tests__/verify-dotnet.sh 3.1.201 2.2.402 diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index f0b685f..b253807 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -3,8 +3,6 @@ if (!$args[0]) throw "Must supply dotnet version argument" } -Get-ChildItem . - $dotnet = Get-Command dotnet | Select-Object -First 1 | ForEach-Object { $_.Path } Write-Host "Found '$dotnet'" From 993f819e3d126cc05ddc7e925e2035e0ea8eab79 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 10:45:20 +0300 Subject: [PATCH 34/62] Debug --- __tests__/verify-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index b253807..859818f 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'" $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" -if ($version -ne $args[0]) +if ($version -contains $args[0]) { Write-Host "PATH='$env:path'" throw "Unexpected version" From fabe7d52fed84a7ca9f0af153967e72999011ffe Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 11:06:13 +0300 Subject: [PATCH 35/62] Debug --- __tests__/verify-dotnet.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 859818f..9c15d91 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'" $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" -if ($version -contains $args[0]) +if ($version -notmatch $args[0]) { Write-Host "PATH='$env:path'" throw "Unexpected version" @@ -19,7 +19,7 @@ if ($args[1]) # SDKs are listed on multiple lines with the path afterwards in square brackets $version = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } Write-Host "Version $version" - if (-not ($version -contains $args[1])) + if ($version -notmatch $args[1]) { Write-Host "PATH='$env:path'" throw "Unexpected version" From 1317beb53a450a50ba1b3117ee67bd093ee7c70e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 11:20:55 +0300 Subject: [PATCH 36/62] Debug --- __tests__/verify-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 9c15d91..3adda6e 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -19,7 +19,7 @@ if ($args[1]) # SDKs are listed on multiple lines with the path afterwards in square brackets $version = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } Write-Host "Version $version" - if ($version -notmatch $args[1]) + if (-not ($version -contains $args[1])) { Write-Host "PATH='$env:path'" throw "Unexpected version" From 054db1cac2d9826a33b8d93004fa2f96b0eca666 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 11:43:20 +0300 Subject: [PATCH 37/62] Debug --- .github/workflows/workflow.yml | 18 ++++++++++-------- __tests__/verify-dotnet.sh | 5 ----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 09340a9..8aad83c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -64,11 +64,12 @@ jobs: run: | if (-Not (Test-Path "../nuget.config")) { throw "nuget file not generated correctly" } - name: Verify dotnet - if: runner.os != 'windows' - run: __tests__/verify-dotnet.sh 3.1.201 2.2.402 - - name: Verify dotnet (Windows) - if: runner.os == 'windows' + # if: runner.os != 'windows' + shell: pwsh run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 + # - name: Verify dotnet (Windows) + # if: runner.os == 'windows' + # run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 test-setup-without-patch-version: runs-on: ${{ matrix.operating-system }} @@ -88,11 +89,12 @@ jobs: with: dotnet-version: '3.1' - name: Verify dotnet - if: runner.os != 'windows' - run: __tests__/verify-dotnet.sh 3.1 - - name: Verify dotnet (Windows) - if: runner.os == 'windows' + # if: runner.os != 'windows' + shell: pwsh run: __tests__/verify-dotnet.ps1 3.1 + # - name: Verify dotnet (Windows) + # if: runner.os == 'windows' + # run: __tests__/verify-dotnet.ps1 3.1 test-setup-x-patch-version: runs-on: ${{ matrix.operating-system }} diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index b8f9492..9807577 100755 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -3,11 +3,6 @@ if [ -z "$1" ]; then exit 1 fi -# if [ ! -f "../nuget.config" ]; then -# echo "nuget file not generated correctly" -# exit 1 -# fi - dotnet_version="$(dotnet --version)" echo "Found dotnet version '$dotnet_version'" if [ -z "$(echo $dotnet_version | grep $1)" ]; then From 44b8627225acba8dee6bb66dafb9ce9c0270f111 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 11:49:04 +0300 Subject: [PATCH 38/62] Debug --- .github/workflows/workflow.yml | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8aad83c..d04b0b6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -64,12 +64,8 @@ jobs: run: | if (-Not (Test-Path "../nuget.config")) { throw "nuget file not generated correctly" } - name: Verify dotnet - # if: runner.os != 'windows' shell: pwsh run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 - # - name: Verify dotnet (Windows) - # if: runner.os == 'windows' - # run: __tests__/verify-dotnet.ps1 3.1.201 2.2.402 test-setup-without-patch-version: runs-on: ${{ matrix.operating-system }} @@ -88,13 +84,13 @@ jobs: uses: ./ with: dotnet-version: '3.1' + - name: Setup dotnet '2.2' + uses: ./ + with: + dotnet-version: '2.2' - name: Verify dotnet - # if: runner.os != 'windows' shell: pwsh - run: __tests__/verify-dotnet.ps1 3.1 - # - name: Verify dotnet (Windows) - # if: runner.os == 'windows' - # run: __tests__/verify-dotnet.ps1 3.1 + run: __tests__/verify-dotnet.ps1 3.1 2.2 test-setup-x-patch-version: runs-on: ${{ matrix.operating-system }} @@ -112,12 +108,13 @@ jobs: uses: ./ with: dotnet-version: 3.1.x + - name: Setup dotnet 2.2.x + uses: ./ + with: + dotnet-version: 2.2.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 + shell: pwsh + run: __tests__/verify-dotnet.ps1 3.1 2.2 test-setup-with-wildcard: runs-on: ${{ matrix.operating-system }} @@ -135,12 +132,13 @@ jobs: uses: ./ with: dotnet-version: 3.1.* + - name: Setup dotnet 2.2.* + uses: ./ + with: + dotnet-version: 2.2.* - 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 + shell: pwsh + run: __tests__/verify-dotnet.ps1 3.1 2.2 test-proxy: runs-on: ubuntu-latest From 7164f75e014cea2eb49d7be8121a3e4eb7a9b0c5 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 12:18:06 +0300 Subject: [PATCH 39/62] Debug --- __tests__/verify-dotnet.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 3adda6e..27e39a0 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -10,18 +10,18 @@ $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" if ($version -notmatch $args[0]) { - Write-Host "PATH='$env:path'" + Write-Host "PATH='$env:PATH'" throw "Unexpected version" } if ($args[1]) { # SDKs are listed on multiple lines with the path afterwards in square brackets - $version = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } - Write-Host "Version $version" - if (-not ($version -contains $args[1])) + $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } | Out-String + Write-Host "Version $versions" + if ($version -notmatch $args[1]) { - Write-Host "PATH='$env:path'" + Write-Host "PATH='$env:PATH'" throw "Unexpected version" } } From f4159a6d20a37dca0d7fd824b37f57b0df1a2c42 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 12:22:20 +0300 Subject: [PATCH 40/62] Debug --- __tests__/verify-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 27e39a0..9193ce1 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -19,7 +19,7 @@ if ($args[1]) # SDKs are listed on multiple lines with the path afterwards in square brackets $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } | Out-String Write-Host "Version $versions" - if ($version -notmatch $args[1]) + if ($versions -notmatch $args[1]) { Write-Host "PATH='$env:PATH'" throw "Unexpected version" From 8889c6748fdf4e4b43c23d9a0b3abdc7d6464246 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 12:31:39 +0300 Subject: [PATCH 41/62] Debug --- __tests__/verify-dotnet.ps1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 9193ce1..eb4dac0 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -17,9 +17,16 @@ if ($version -notmatch $args[0]) if ($args[1]) { # SDKs are listed on multiple lines with the path afterwards in square brackets - $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } | Out-String - Write-Host "Version $versions" - if ($versions -notmatch $args[1]) + $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } + Write-Host "Installed versions: $versions" + $isInstalledVersion = $false + foreach ($version in $versions) { + if ($version.StartsWith($args[1])) { + $isInstalledVersion = $true + break + } + } + if (-not $isInstalledVersion) { Write-Host "PATH='$env:PATH'" throw "Unexpected version" From 5d1a72cb19a61884353d2bfd145cfe93814c2bd5 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 12:39:11 +0300 Subject: [PATCH 42/62] Debug --- __tests__/verify-dotnet.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index eb4dac0..d6300e9 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -21,7 +21,7 @@ if ($args[1]) Write-Host "Installed versions: $versions" $isInstalledVersion = $false foreach ($version in $versions) { - if ($version.StartsWith($args[1])) { + if ($version.StartsWith($args[1].ToString())) { $isInstalledVersion = $true break } From a841c568fd981d4173916359d2392264eb39423b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:26:18 +0300 Subject: [PATCH 43/62] Minor fixes --- __tests__/verify-dotnet.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index d6300e9..cd18c3a 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'" $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" -if ($version -notmatch $args[0]) +if (-not ($version.StartsWith($args[0]))) { Write-Host "PATH='$env:PATH'" throw "Unexpected version" @@ -20,8 +20,10 @@ if ($args[1]) $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } Write-Host "Installed versions: $versions" $isInstalledVersion = $false - foreach ($version in $versions) { - if ($version.StartsWith($args[1].ToString())) { + foreach ($version in $versions) + { + if ($version.StartsWith($args[1].ToString())) + { $isInstalledVersion = $true break } From 92451e3d46dccb81c36610dd65109e995bac9044 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:27:35 +0300 Subject: [PATCH 44/62] Remove workflow dispatch event --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d04b0b6..c6be8ae 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,7 +1,6 @@ name: Main workflow on: - workflow_dispatch: pull_request: paths-ignore: - '**.md' From ac1baccba42f820212bdabf6d85e750ed32cef3b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:30:33 +0300 Subject: [PATCH 45/62] Minor fix --- __tests__/verify-dotnet.ps1 | 2 +- __tests__/verify-dotnet.sh | 39 ------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100755 __tests__/verify-dotnet.sh diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index cd18c3a..909fc52 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'" $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" -if (-not ($version.StartsWith($args[0]))) +if (-not ($version.StartsWith($args[0].ToString())) { Write-Host "PATH='$env:PATH'" throw "Unexpected version" diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh deleted file mode 100755 index 9807577..0000000 --- a/__tests__/verify-dotnet.sh +++ /dev/null @@ -1,39 +0,0 @@ -if [ -z "$1" ]; then - echo "Must supply dotnet version argument" - exit 1 -fi - -dotnet_version="$(dotnet --version)" -echo "Found dotnet version '$dotnet_version'" -if [ -z "$(echo $dotnet_version | grep $1)" ]; then - echo "Unexpected version" - exit 1 -fi - -if [ -n "$2" ]; then - dotnet_version="$(dotnet --list-sdks)" - echo "Found dotnet version '$dotnet_version'" - if [ -z "$(echo $dotnet_version | grep $2)" ]; then - echo "Unexpected version" - exit 1 - fi -fi - -echo "Building sample csproj" -dotnet build __tests__/sample-csproj/ --no-cache || exit 1 - -echo "Testing compiled app" -sample_output=$(dotnet test __tests__/sample-csproj/ --no-build) -echo "Sample output: $sample_output" -# For Side-by-Side installs we want to run the tests twice, for a single install the tests will run once -if [ -n "$2" ]; then - if [ -z "$(echo $sample_output | grep "Test Run Successful.*Test Run Successful.")" ]; then - echo "Unexpected output" - exit 1 - fi -else - if [ -z "$(echo $sample_output | grep "Test Run Successful.")" ]; then - echo "Unexpected output" - exit 1 - fi -fi \ No newline at end of file From 1c7be1087d5c726130d759e9046fa35ba65b43c8 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:41:45 +0300 Subject: [PATCH 46/62] Debug --- .github/workflows/workflow.yml | 6 ++++-- __tests__/verify-dotnet.ps1 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c6be8ae..6c00c2d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -169,7 +169,8 @@ jobs: env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet - run: __tests__/verify-dotnet.sh 3.1.201 + shell: pwsh + run: __tests__/verify-dotnet.ps1 3.1.201 test-bypass-proxy: runs-on: ubuntu-latest @@ -189,4 +190,5 @@ jobs: env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet - run: __tests__/verify-dotnet.sh 3.1.201 + shell: pwsh + run: __tests__/verify-dotnet.ps1 3.1.201 diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 909fc52..f9b8913 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'" $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() } Write-Host "Version $version" -if (-not ($version.StartsWith($args[0].ToString())) +if (-not ($version.StartsWith($args[0].ToString()))) { Write-Host "PATH='$env:PATH'" throw "Unexpected version" From 4a01d86a5b643f772298b0b722dce83769de22f0 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:48:03 +0300 Subject: [PATCH 47/62] Debug --- .github/workflows/workflow.yml | 6 ++--- __tests__/verify-dotnet.sh | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 __tests__/verify-dotnet.sh diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6c00c2d..c6be8ae 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -169,8 +169,7 @@ jobs: env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet - shell: pwsh - run: __tests__/verify-dotnet.ps1 3.1.201 + run: __tests__/verify-dotnet.sh 3.1.201 test-bypass-proxy: runs-on: ubuntu-latest @@ -190,5 +189,4 @@ jobs: env: NUGET_AUTH_TOKEN: NOTATOKEN - name: Verify dotnet - shell: pwsh - run: __tests__/verify-dotnet.ps1 3.1.201 + run: __tests__/verify-dotnet.sh 3.1.201 diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh new file mode 100644 index 0000000..098d076 --- /dev/null +++ b/__tests__/verify-dotnet.sh @@ -0,0 +1,44 @@ +if [ -z "$1" ]; then + echo "Must supply dotnet version argument" + exit 1 +fi + +if [ ! -f "../nuget.config" ]; then + echo "nuget file not generated correctly" + exit 1 +fi + +dotnet_version="$(dotnet --version)" +echo "Found dotnet version '$dotnet_version'" +if [ -z "$(echo $dotnet_version | grep $1)" ]; then + echo "Unexpected version" + exit 1 +fi + +if [ -n "$2" ]; then + dotnet_version="$(dotnet --list-sdks)" + echo "Found dotnet version '$dotnet_version'" + if [ -z "$(echo $dotnet_version | grep $2)" ]; then + echo "Unexpected version" + exit 1 + fi +fi + +echo "Building sample csproj" +dotnet build __tests__/sample-csproj/ --no-cache || exit 1 + +echo "Testing compiled app" +sample_output=$(dotnet test __tests__/sample-csproj/ --no-build) +echo "Sample output: $sample_output" +# For Side-by-Side installs we want to run the tests twice, for a single install the tests will run once +if [ -n "$2" ]; then + if [ -z "$(echo $sample_output | grep "Test Run Successful.*Test Run Successful.")" ]; then + echo "Unexpected output" + exit 1 + fi +else + if [ -z "$(echo $sample_output | grep "Test Run Successful.")" ]; then + echo "Unexpected output" + exit 1 + fi +fi \ No newline at end of file From 0cb99b2a127fa95969a52d7d8eebb92d97809409 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:53:22 +0300 Subject: [PATCH 48/62] Debug --- __tests__/verify-dotnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index 098d076..3854f4a 100644 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -41,4 +41,4 @@ else echo "Unexpected output" exit 1 fi -fi \ No newline at end of file +fi From 58652342477a9270614db65a09f7ee7036270bee Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:54:21 +0300 Subject: [PATCH 49/62] Minor fix --- __tests__/verify-dotnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index 3854f4a..098d076 100644 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -41,4 +41,4 @@ else echo "Unexpected output" exit 1 fi -fi +fi \ No newline at end of file From cfb7e25be15d2e8fbf4d34d44516903267d0f04d Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 13:55:28 +0300 Subject: [PATCH 50/62] Minor fix --- __tests__/verify-dotnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index 098d076..3854f4a 100644 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -41,4 +41,4 @@ else echo "Unexpected output" exit 1 fi -fi \ No newline at end of file +fi From 92ffa484b196d2d3f3a33969a7092fd964acda28 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 14:02:30 +0300 Subject: [PATCH 51/62] Minor fix --- __tests__/verify-dotnet.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 __tests__/verify-dotnet.sh diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh old mode 100644 new mode 100755 From 2a58294d0c6e96b2b009a32ac98dc8225e5a824c Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 14:09:28 +0300 Subject: [PATCH 52/62] Minor fix --- __tests__/verify-dotnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/verify-dotnet.sh b/__tests__/verify-dotnet.sh index 3854f4a..098d076 100755 --- a/__tests__/verify-dotnet.sh +++ b/__tests__/verify-dotnet.sh @@ -41,4 +41,4 @@ else echo "Unexpected output" exit 1 fi -fi +fi \ No newline at end of file From e1655545c187cade15d93627c820efbba733be21 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 14:24:06 +0300 Subject: [PATCH 53/62] Minor fix --- __tests__/clear-toolcache.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 60f630c..1fed65d 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -20,4 +20,4 @@ foreach ($path in $pathsToClear) { Write-Host "Clear $path path" Remove-Item $path -Recurse -Force } -} +} \ No newline at end of file From c1ca14bb7bda20018cb42ffecabcfb3123a245ab Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 14:33:49 +0300 Subject: [PATCH 54/62] Rename stages --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c6be8ae..16b8f24 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -91,7 +91,7 @@ jobs: shell: pwsh run: __tests__/verify-dotnet.ps1 3.1 2.2 - test-setup-x-patch-version: + test-setup-latest-patch-version: runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false From c0d7255256c4869c2d69195ccc14e45f6d72b72b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 15:14:09 +0300 Subject: [PATCH 55/62] Rework cleanup script --- __tests__/clear-toolcache.ps1 | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 1fed65d..44ba345 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -1,21 +1,11 @@ -$os = $args[0] - -$linuxDotnetPaths = @("/usr/share/dotnet") -$macOSDotnetPaths = @("$env:HOME/.dotnet") -$windowsDotnetPaths = @("$env:ProgramFiles\dotnet/*", - "$env:LocalAppData\Microsoft\dotnet/*") - -$pathsToClear = @() - -if ($os -eq "Linux") { - $pathsToClear = $linuxDotnetPaths -} elseif ($os -eq "macOS") { - $pathsToClear = $macOSDotnetPaths -} elseif ($os -eq "Windows") { - $pathsToClear = $windowsDotnetPaths +$dotnetPaths = @{ + Linux = @("/usr/share/dotnet") + macOS = @("$env:HOME/.dotnet") + Windows = @("$env:ProgramFiles\dotnet/*", + "$env:LocalAppData\Microsoft\dotnet/*") } -foreach ($path in $pathsToClear) { +foreach ($path in $dotnetPaths[$args[0]]) { if (Test-Path $path) { Write-Host "Clear $path path" Remove-Item $path -Recurse -Force From 8e5c71c8f8310a3f662035df478209f8523d3d41 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 18:26:17 +0300 Subject: [PATCH 56/62] Set ubuntu-latest --- .github/workflows/workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 16b8f24..9ee782a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 @@ -96,7 +96,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 @@ -120,7 +120,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-latest, macOS-latest] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout uses: actions/checkout@v2 From 19e6ad3fe098973eef450ce13aaef88c4073e8c4 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:12:47 +0300 Subject: [PATCH 57/62] Add tests --- .github/workflows/test-dotnet.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test-dotnet.yml diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml new file mode 100644 index 0000000..c1a6acb --- /dev/null +++ b/.github/workflows/test-dotnet.yml @@ -0,0 +1,31 @@ +name: Validate dotnet + +on: + pull_request: + paths-ignore: + - '**.md' + push: + branches: + - main + - releases/* + paths-ignore: + - '**.md' + +jobs: + setup-version: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + dotnet-version: [2.1, 2.2, 3.1, 5.0] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Clear toolcache + shell: pwsh + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} + - name: Setup dotnet ${{ matrix.dotnet-version }} + uses: ./ + with: + dotnet-version: "${{ matrix.dotnet-version }}" \ No newline at end of file From f39691d15560cda10180a8d5ab12673ac228b916 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:16:43 +0300 Subject: [PATCH 58/62] Debug --- .github/workflows/test-dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index c1a6acb..b48fc32 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] - dotnet-version: [2.1, 2.2, 3.1, 5.0] + dotnet-version: ['2.1', '2.2', '3.0', 3.1', '5.0'] steps: - name: Checkout uses: actions/checkout@v2 @@ -28,4 +28,4 @@ jobs: - name: Setup dotnet ${{ matrix.dotnet-version }} uses: ./ with: - dotnet-version: "${{ matrix.dotnet-version }}" \ No newline at end of file + dotnet-version: ${{ matrix.dotnet-version }} \ No newline at end of file From 9427b17c422eb7ce75f9d4d6ea40455f109fb16b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:18:34 +0300 Subject: [PATCH 59/62] Minor fix --- .github/workflows/test-dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index b48fc32..bd2cbe5 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] - dotnet-version: ['2.1', '2.2', '3.0', 3.1', '5.0'] + dotnet-version: ['2.1', '2.2', '3.0', '3.1', '5.0'] steps: - name: Checkout uses: actions/checkout@v2 From f311b6d97873314aa296d7a359adb538442b4fc3 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:27:32 +0300 Subject: [PATCH 60/62] Debug --- .github/workflows/test-dotnet.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index bd2cbe5..248ec3a 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -28,4 +28,9 @@ jobs: - name: Setup dotnet ${{ matrix.dotnet-version }} uses: ./ with: - dotnet-version: ${{ matrix.dotnet-version }} \ No newline at end of file + dotnet-version: ${{ matrix.dotnet-version }} + - name: Check installed version + shell: pwsh + run: | + $version = & dotnet --version + if (-not $version.StartsWith(${{ matrix.dotnet-version }})) { throw "Unexpected version" } \ No newline at end of file From d99c06115db22035d01520b714a1136661a06f8e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:32:37 +0300 Subject: [PATCH 61/62] Debug --- .github/workflows/test-dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index 248ec3a..5922828 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -33,4 +33,4 @@ jobs: shell: pwsh run: | $version = & dotnet --version - if (-not $version.StartsWith(${{ matrix.dotnet-version }})) { throw "Unexpected version" } \ No newline at end of file + if (-not $version.StartsWith("${{ matrix.dotnet-version }}")) { throw "Unexpected version" } \ No newline at end of file From c32ed2108bd112acf06d4223c689ed228ab3c6bb Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 10:44:00 +0300 Subject: [PATCH 62/62] Debug --- .github/workflows/test-dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml index 5922828..b585d56 100644 --- a/.github/workflows/test-dotnet.yml +++ b/.github/workflows/test-dotnet.yml @@ -33,4 +33,5 @@ jobs: shell: pwsh run: | $version = & dotnet --version + Write-Host "Installed version: $version" if (-not $version.StartsWith("${{ matrix.dotnet-version }}")) { throw "Unexpected version" } \ No newline at end of file