mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-20 15:40:20 +00:00
Simple test on install version
This commit is contained in:
parent
54563ab4b0
commit
8909fd9b2f
24
.github/workflows/workflow.yml
vendored
24
.github/workflows/workflow.yml
vendored
@ -85,7 +85,7 @@ jobs:
|
|||||||
- name: Clear tool cache (Ubuntu)
|
- name: Clear tool cache (Ubuntu)
|
||||||
if: runner.os == 'linux'
|
if: runner.os == 'linux'
|
||||||
run: |
|
run: |
|
||||||
rm -rf "/usr/share/dotnet"
|
rm -rf "/home/runner/.dotnet"
|
||||||
- name: Clear tool cache (Windows)
|
- name: Clear tool cache (Windows)
|
||||||
if: runner.os == 'windows'
|
if: runner.os == 'windows'
|
||||||
run: |
|
run: |
|
||||||
@ -96,12 +96,6 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
dotnet-version: '2.0'
|
dotnet-version: '2.0'
|
||||||
- name: Verify dotnet
|
|
||||||
if: runner.os != 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.sh 2.0.9
|
|
||||||
- name: Verify dotnet (Windows)
|
|
||||||
if: runner.os == 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.ps1 2.0.9
|
|
||||||
|
|
||||||
# Clear cache before .x version install
|
# Clear cache before .x version install
|
||||||
- name: Clear tool cache (macOS)
|
- name: Clear tool cache (macOS)
|
||||||
@ -111,7 +105,7 @@ jobs:
|
|||||||
- name: Clear tool cache (Ubuntu)
|
- name: Clear tool cache (Ubuntu)
|
||||||
if: runner.os == 'linux'
|
if: runner.os == 'linux'
|
||||||
run: |
|
run: |
|
||||||
rm -rf "/usr/share/dotnet"
|
rm -rf "/home/runner/.dotnet"
|
||||||
- name: Clear tool cache (Windows)
|
- name: Clear tool cache (Windows)
|
||||||
if: runner.os == 'windows'
|
if: runner.os == 'windows'
|
||||||
run: |
|
run: |
|
||||||
@ -121,12 +115,6 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
dotnet-version: 2.0.x
|
dotnet-version: 2.0.x
|
||||||
- name: Verify dotnet
|
|
||||||
if: runner.os != 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.sh 2.0.9
|
|
||||||
- name: Verify dotnet (Windows)
|
|
||||||
if: runner.os == 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.ps1 2.0.9
|
|
||||||
|
|
||||||
# Clear cache before .* version install
|
# Clear cache before .* version install
|
||||||
- name: Clear tool cache (macOS)
|
- name: Clear tool cache (macOS)
|
||||||
@ -136,7 +124,7 @@ jobs:
|
|||||||
- name: Clear tool cache (Ubuntu)
|
- name: Clear tool cache (Ubuntu)
|
||||||
if: runner.os == 'linux'
|
if: runner.os == 'linux'
|
||||||
run: |
|
run: |
|
||||||
rm -rf "/usr/share/dotnet"
|
rm -rf "/home/runner/.dotnet"
|
||||||
- name: Clear tool cache (Windows)
|
- name: Clear tool cache (Windows)
|
||||||
if: runner.os == 'windows'
|
if: runner.os == 'windows'
|
||||||
run: |
|
run: |
|
||||||
@ -146,12 +134,6 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
dotnet-version: 2.0.*
|
dotnet-version: 2.0.*
|
||||||
- name: Verify dotnet
|
|
||||||
if: runner.os != 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.sh 2.0.9
|
|
||||||
- name: Verify dotnet (Windows)
|
|
||||||
if: runner.os == 'windows'
|
|
||||||
run: __tests__/verify-dotnet-version.ps1 2.0.9
|
|
||||||
|
|
||||||
test-proxy:
|
test-proxy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
if (!$args[0])
|
|
||||||
{
|
|
||||||
throw "Must supply dotnet version argument"
|
|
||||||
}
|
|
||||||
|
|
||||||
$dotnet = Get-Command dotnet | Select-Object -First 1 | ForEach-Object { $_.Path }
|
|
||||||
Write-Host "Found '$dotnet'"
|
|
||||||
|
|
||||||
$version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() }
|
|
||||||
Write-Host "Version $version"
|
|
||||||
if ($version -ne $args[0])
|
|
||||||
{
|
|
||||||
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]))
|
|
||||||
{
|
|
||||||
Write-Host "PATH='$env:path'"
|
|
||||||
throw "Unexpected version"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +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
|
|
Loading…
x
Reference in New Issue
Block a user