mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
* Add install of dotnet tools - Add new section under dotnet. - Add installer for dotnet tools. - Add tests for dotnet tools. - Add dotnet tools to software report. * Fixes from code review * Add test and version check to dotnet tool json - Rework installer to use tool name. - Rework test to call tool test. - Rework software report to use tool specific command to get version. * Fixes from code review * Fix test for nbgv * Fix linux installer * Fix name for test context. * Update images/linux/scripts/installers/dotnetcore-sdk.sh Co-authored-by: PJ <me@panekj.dev> * Update images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 Co-authored-by: PJ <me@panekj.dev> * Update images/win/scripts/Tests/DotnetSDK.Tests.ps1 Co-authored-by: PJ <me@panekj.dev> * Aligning PS1 between win and linux * Remove out * Add Nuget.org as feed source for installing tool * Fix tests * Fix getting tool version * Change from code review * Update images/win/toolsets/toolset-2022.json Co-authored-by: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> * Update images/win/toolsets/toolset-2019.json Co-authored-by: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> * Update images/win/toolsets/toolset-2016.json Co-authored-by: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> * Changes from code review * Change from code revision * Fix tests * dotnet tool is now installed to a tool path * Move dotnet tools install - Need to install the dotnet tools AFTER post install steps otherwise dotnet is not in the path. * Fxi typo in path * Add path to software report for dotnet tools * Remove new line (from code review) * Add progress output message to dotnet tools install * Change install path for tool * New updating PATH with dotnet tools location * Remove duplicated assigment * Remove output message and add back Out-null Co-authored-by: PJ <me@panekj.dev> Co-authored-by: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com>
42 lines
1.3 KiB
PowerShell
42 lines
1.3 KiB
PowerShell
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
|
|
|
Describe "Dotnet and tools" {
|
|
|
|
BeforeAll {
|
|
$env:PATH = "/etc/skel/.dotnet/tools:$($env:PATH)"
|
|
$dotnetSDKs = dotnet --list-sdks | ConvertTo-Json
|
|
$dotnetRuntimes = dotnet --list-runtimes | ConvertTo-Json
|
|
}
|
|
|
|
$dotnetVersions = (Get-ToolsetContent).dotnet.versions
|
|
|
|
Context "Default" {
|
|
It "Default Dotnet SDK is available" {
|
|
"dotnet --version" | Should -ReturnZeroExitCode
|
|
}
|
|
}
|
|
|
|
foreach ($version in $dotnetVersions) {
|
|
Context "Dotnet $version" {
|
|
$dotnet = @{ dotnetVersion = $version }
|
|
|
|
It "SDK $version is available" -TestCases $dotnet {
|
|
$dotnetSDKs | Should -Match "$dotnetVersion.[1-9]*"
|
|
}
|
|
|
|
It "Runtime $version is available" -TestCases $dotnet {
|
|
$dotnetRuntimes | Should -Match "$dotnetVersion.[1-9]*"
|
|
}
|
|
}
|
|
}
|
|
|
|
Context "Dotnet tools" {
|
|
$dotnetTools = (Get-ToolsetContent).dotnet.tools
|
|
$testCases = $dotnetTools | ForEach-Object { @{ ToolName = $_.name; TestInstance = $_.test }}
|
|
|
|
It "<ToolName> is available" -TestCases $testCases {
|
|
"$TestInstance" | Should -ReturnZeroExitCode
|
|
}
|
|
}
|
|
|
|
} |