From dd32dd730ca6e64ab361d4cbabd8c3ae66c112eb Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 13:35:45 +0200 Subject: [PATCH 01/11] Update installers --- externals/install-dotnet.ps1 | 459 ++++++++++++++++++----------------- externals/install-dotnet.sh | 14 +- 2 files changed, 245 insertions(+), 228 deletions(-) diff --git a/externals/install-dotnet.ps1 b/externals/install-dotnet.ps1 index b0b131acd..c9a30cb3c 100644 --- a/externals/install-dotnet.ps1 +++ b/externals/install-dotnet.ps1 @@ -9,6 +9,12 @@ .DESCRIPTION Installs dotnet cli. If dotnet installation already exists in the given directory it will update it only if the requested version differs from the one already installed. + + Note that the intended use of this script is for Continuous Integration (CI) scenarios, where: + - The SDK needs to be installed without user interaction and without admin rights. + - The SDK installation doesn't need to persist across multiple CI runs. + To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer. + .PARAMETER Channel Default: LTS Download from the Channel specified. Possible values: @@ -164,6 +170,12 @@ function Say-Verbose($str) { } } +function Measure-Action($name, $block) { + $time = Measure-Command $block + $totalSeconds = $time.TotalSeconds + Say-Verbose "⏱ Action '$name' took $totalSeconds seconds" +} + function Say-Invocation($Invocation) { $command = $Invocation.MyCommand; $args = (($Invocation.BoundParameters.Keys | foreach { "-$_ `"$($Invocation.BoundParameters[$_])`"" }) -join " ") @@ -1104,10 +1116,10 @@ function Prepare-Install-Directory { } } -Say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" -Say "- The SDK needs to be installed without user interaction and without admin rights." -Say "- The SDK installation doesn't need to persist across multiple CI runs." -Say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n" +Say-Verbose "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" +Say-Verbose "- The SDK needs to be installed without user interaction and without admin rights." +Say-Verbose "- The SDK installation doesn't need to persist across multiple CI runs." +Say-Verbose "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n" if ($SharedRuntime -and (-not $Runtime)) { $Runtime = "dotnet" @@ -1115,14 +1127,16 @@ if ($SharedRuntime -and (-not $Runtime)) { $OverrideNonVersionedFiles = !$SkipNonVersionedFiles -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$NormalizedQuality = Get-NormalizedQuality $Quality -Say-Verbose "Normalized quality: '$NormalizedQuality'" -$NormalizedChannel = Get-NormalizedChannel $Channel -Say-Verbose "Normalized channel: '$NormalizedChannel'" -$NormalizedProduct = Get-NormalizedProduct $Runtime -Say-Verbose "Normalized product: '$NormalizedProduct'" -$FeedCredential = ValidateFeedCredential $FeedCredential +Measure-Action "Product discovery" { + $script:CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture + $script:NormalizedQuality = Get-NormalizedQuality $Quality + Say-Verbose "Normalized quality: '$NormalizedQuality'" + $script:NormalizedChannel = Get-NormalizedChannel $Channel + Say-Verbose "Normalized channel: '$NormalizedChannel'" + $script:NormalizedProduct = Get-NormalizedProduct $Runtime + Say-Verbose "Normalized product: '$NormalizedProduct'" + $script:FeedCredential = ValidateFeedCredential $FeedCredential +} $InstallRoot = Resolve-Installation-Path $InstallDir Say-Verbose "InstallRoot: $InstallRoot" @@ -1200,7 +1214,7 @@ if ($DryRun) { return } -Prepare-Install-Directory +Measure-Action "Installation directory preparation" { Prepare-Install-Directory } $ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) Say-Verbose "Zip path: $ZipPath" @@ -1214,7 +1228,7 @@ foreach ($link in $DownloadLinks) Say-Verbose "Downloading `"$($link.type)`" link $($link.downloadLink)" try { - DownloadFile -Source $link.downloadLink -OutPath $ZipPath + Measure-Action "Package download" { DownloadFile -Source $link.downloadLink -OutPath $ZipPath } Say-Verbose "Download succeeded." $DownloadSucceeded = $true $DownloadedLink = $link @@ -1251,7 +1265,7 @@ if (-not $DownloadSucceeded) { } Say "Extracting the archive." -Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot +Measure-Action "Package extraction" { Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot } # Check if the SDK version is installed; if not, fail the installation. $isAssetInstalled = $false @@ -1277,225 +1291,224 @@ if (!$isAssetInstalled) { SafeRemoveFile -Path $ZipPath -Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot +Measure-Action "Setting up shell environment" { Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot } Say "Note that the script does not resolve dependencies during installation." Say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies" Say "Installed version is $($DownloadedLink.effectiveVersion)" Say "Installation finished" - # SIG # Begin signature block -# MIInzgYJKoZIhvcNAQcCoIInvzCCJ7sCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB7pzZ0nuEMd30h -# n1EcAYUQN+1clltqaLf9611TDrw/laCCDYUwggYDMIID66ADAgECAhMzAAACzfNk -# v/jUTF1RAAAAAALNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBhfTi3SRn7+vyy +# uCXKPjhiawegWZ493EcaOEycbgkZcKCCDXYwggX0MIID3KADAgECAhMzAAACy7d1 +# OfsCcUI2AAAAAALLMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT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vPFF8QP7Ac1saIe1+gUFNcsYOLaMm/xl8E6kefWwZnm5Rhm606g1AC/ +# N5Wo08aAs0ymTPH91dEbmOURXLbA3vCyG7kbfgnhCs/j7oQHWaFDzEYuXDIA4ICT +# dxPUTltbq3OWdp0PAS8JSEKPQFaOoQEnPa4adrXWxMvOmel8IGqJiQ+BPOaLQG64 +# Qu2tMkH/5szb1fsEnCe8SJmy5ESF+kmpnLBtJ17Y9o+9nJHF5ddFmvzy+LUaIqDN +# cOfH # SIG # End signature block diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index ecb2b6cf1..bdaa67efa 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -1617,6 +1617,10 @@ do echo " $script_name -h|-?|--help" echo "" echo "$script_name is a simple command line interface for obtaining dotnet cli." + echo " Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" + echo " - The SDK needs to be installed without user interaction and without admin rights." + echo " - The SDK installation doesn't need to persist across multiple CI runs." + echo " To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer." echo "" echo "Options:" echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." @@ -1694,10 +1698,10 @@ do shift done -say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" -say "- The SDK needs to be installed without user interaction and without admin rights." -say "- The SDK installation doesn't need to persist across multiple CI runs." -say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" +say_verbose "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" +say_verbose "- The SDK needs to be installed without user interaction and without admin rights." +say_verbose "- The SDK installation doesn't need to persist across multiple CI runs." +say_verbose "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" if [ "$internal" = true ] && [ -z "$(echo $feed_credential)" ]; then message="Provide credentials via --feed-credential parameter." @@ -1731,4 +1735,4 @@ fi say "Note that the script does not resolve dependencies during installation." say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section." -say "Installation finished successfully." +say "Installation finished successfully." \ No newline at end of file From 6d92b9bd5393d09715a60dd0726c5b2382cab757 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 14:07:46 +0200 Subject: [PATCH 02/11] Refactor install dir computation --- dist/index.js | 37 ++++++++++++++++++------------------- src/installer.ts | 36 ++++++++++++------------------------ src/utils.ts | 5 +++++ 3 files changed, 35 insertions(+), 43 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8e20d7f57..aa4b7a553 100644 --- a/dist/index.js +++ b/dist/index.js @@ -419,24 +419,15 @@ class DotnetCoreInstaller { exports.DotnetCoreInstaller = DotnetCoreInstaller; _a = DotnetCoreInstaller; (() => { - const installationDirectoryWindows = path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet'); - const installationDirectoryLinux = '/usr/share/dotnet'; - const installationDirectoryMac = path_1.default.join(process.env['HOME'] + '', '.dotnet'); - const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR']; - if (dotnetInstallDir) { - process.env['DOTNET_INSTALL_DIR'] = - _a.convertInstallPathToAbsolute(dotnetInstallDir); - } - else { - if (utils_1.IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = installationDirectoryWindows; - } - else { - process.env['DOTNET_INSTALL_DIR'] = utils_1.IS_LINUX - ? installationDirectoryLinux - : installationDirectoryMac; - } - } + const dotnetInstallDirDefault = { + linux: '/usr/share/dotnet', + mac: path_1.default.join(process.env['HOME'] + '', '.dotnet'), + windows: path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet') + }[(0, utils_1.getPlatform)()]; + const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR'] + ? _a.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) + : dotnetInstallDirDefault; + process.env['DOTNET_INSTALL_DIR'] = dotnetInstallDir; })(); @@ -591,9 +582,17 @@ run(); "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IS_LINUX = exports.IS_WINDOWS = void 0; +exports.getPlatform = exports.IS_LINUX = exports.IS_WINDOWS = void 0; exports.IS_WINDOWS = process.platform === 'win32'; exports.IS_LINUX = process.platform === 'linux'; +const getPlatform = () => { + if (exports.IS_WINDOWS) + return 'windows'; + if (exports.IS_LINUX) + return 'linux'; + return 'mac'; +}; +exports.getPlatform = getPlatform; /***/ }), diff --git a/src/installer.ts b/src/installer.ts index ef9e99304..b2132ef8e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -8,7 +8,7 @@ import {readdir} from 'fs/promises'; import path from 'path'; import os from 'os'; import semver from 'semver'; -import {IS_LINUX, IS_WINDOWS} from './utils'; +import {IS_WINDOWS, getPlatform} from './utils'; import {QualityOptions} from './setup-dotnet'; export interface DotnetVersion { @@ -115,29 +115,17 @@ export class DotnetCoreInstaller { private quality: QualityOptions; static { - const installationDirectoryWindows = path.join( - process.env['PROGRAMFILES'] + '', - 'dotnet' - ); - const installationDirectoryLinux = '/usr/share/dotnet'; - const installationDirectoryMac = path.join( - process.env['HOME'] + '', - '.dotnet' - ); - const dotnetInstallDir: string | undefined = - process.env['DOTNET_INSTALL_DIR']; - if (dotnetInstallDir) { - process.env['DOTNET_INSTALL_DIR'] = - this.convertInstallPathToAbsolute(dotnetInstallDir); - } else { - if (IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = installationDirectoryWindows; - } else { - process.env['DOTNET_INSTALL_DIR'] = IS_LINUX - ? installationDirectoryLinux - : installationDirectoryMac; - } - } + const dotnetInstallDirDefault = { + linux: '/usr/share/dotnet', + mac: path.join(process.env['HOME'] + '', '.dotnet'), + windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet') + }[getPlatform()]; + + const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR'] + ? this.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) + : dotnetInstallDirDefault; + + process.env['DOTNET_INSTALL_DIR'] = dotnetInstallDir; } constructor(version: string, quality: QualityOptions) { diff --git a/src/utils.ts b/src/utils.ts index 77886ce0e..d671d7042 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,2 +1,7 @@ export const IS_WINDOWS = process.platform === 'win32'; export const IS_LINUX = process.platform === 'linux'; +export const getPlatform = (): 'windows' | 'linux' | 'mac' => { + if (IS_WINDOWS) return 'windows'; + if (IS_LINUX) return 'linux'; + return 'mac'; +}; From aa85432603f42dabe849d900c34011b215608e21 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 16:28:16 +0200 Subject: [PATCH 03/11] Refactor installer --- __tests__/installer.test.ts | 14 +-- dist/index.js | 174 +++++++++++++++++-------------- src/installer.ts | 200 ++++++++++++++++++++---------------- 3 files changed, 215 insertions(+), 173 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 1a7e0248e..becedea7c 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -117,7 +117,7 @@ describe('DotnetCoreInstaller tests', () => { it('Throws if no location contains correct dotnet version', async () => { await expect(async () => { - await getDotnet('1000.0.0'); + await getDotnet('1000.0.0') }).rejects.toThrow(); }, 30000); @@ -177,7 +177,7 @@ describe('DotnetVersionResolver tests', () => { const dotnetVersionResolver = new installer.DotnetVersionResolver( version ); - const versionObject = await dotnetVersionResolver.createDotNetVersion(); + const versionObject = await dotnetVersionResolver.createDotnetVersion(); expect(!!versionObject.value).toBe(true); } @@ -216,7 +216,7 @@ describe('DotnetVersionResolver tests', () => { ); await expect( - async () => await dotnetVersionResolver.createDotNetVersion() + async () => await dotnetVersionResolver.createDotnetVersion() ).rejects.toThrow(); } ); @@ -227,7 +227,7 @@ describe('DotnetVersionResolver tests', () => { const dotnetVersionResolver = new installer.DotnetVersionResolver( version ); - const versionObject = await dotnetVersionResolver.createDotNetVersion(); + const versionObject = await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('channel')).toBe(true); } @@ -239,7 +239,7 @@ describe('DotnetVersionResolver tests', () => { const dotnetVersionResolver = new installer.DotnetVersionResolver( version ); - const versionObject = await dotnetVersionResolver.createDotNetVersion(); + const versionObject = await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('channel')).toBe(true); expect(versionObject.qualityFlag).toBe(true); @@ -252,7 +252,7 @@ describe('DotnetVersionResolver tests', () => { const dotnetVersionResolver = new installer.DotnetVersionResolver( version ); - const versionObject = await dotnetVersionResolver.createDotNetVersion(); + const versionObject = await dotnetVersionResolver.createDotnetVersion(); expect(versionObject.type.toLowerCase().includes('version')).toBe(true); expect(versionObject.qualityFlag).toBe(false); @@ -265,7 +265,7 @@ describe('DotnetVersionResolver tests', () => { const dotnetVersionResolver = new installer.DotnetVersionResolver( version ); - const versionObject = await dotnetVersionResolver.createDotNetVersion(); + const versionObject = await dotnetVersionResolver.createDotnetVersion(); const windowsRegEx = new RegExp(/^-[VC]/); const nonWindowsRegEx = new RegExp(/^--[vc]/); diff --git a/dist/index.js b/dist/index.js index aa4b7a553..727b6cac7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -229,9 +229,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; -var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DotnetCoreInstaller = exports.DotnetVersionResolver = void 0; +exports.DotnetCoreInstaller = exports.DotnetInstallDir = exports.DotnetInstallScript = exports.DotnetVersionResolver = void 0; // Load tempDirectory before it gets wiped by tool-cache const core = __importStar(__nccwpck_require__(2186)); const exec = __importStar(__nccwpck_require__(1514)); @@ -279,7 +278,7 @@ class DotnetVersionResolver { isNumericTag(versionTag) { return /^\d+$/.test(versionTag); } - createDotNetVersion() { + createDotnetVersion() { return __awaiter(this, void 0, void 0, function* () { yield this.resolveVersionInput(); if (!this.resolvedArgument.type) { @@ -314,11 +313,77 @@ class DotnetVersionResolver { } exports.DotnetVersionResolver = DotnetVersionResolver; DotnetVersionResolver.DotNetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; -class DotnetCoreInstaller { - constructor(version, quality) { - this.version = version; - this.quality = quality; +class DotnetInstallScript { + constructor() { + this.scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh'; + this.scriptArguments = []; + this.scriptPath = ''; + this.escapedScript = path_1.default + .join(__dirname, '..', 'externals', this.scriptName) + .replace(/'/g, "''"); + this.scriptReady = utils_1.IS_WINDOWS + ? this.setupScriptPowershell() + : this.setupScriptBash(); + } + setupScriptPowershell() { + return __awaiter(this, void 0, void 0, function* () { + this.scriptArguments = [ + '-NoLogo', + '-Sta', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command' + ]; + this.scriptArguments.push('&', `'${this.escapedScript}'`); + if (process.env['https_proxy'] != null) { + this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`); + } + // This is not currently an option + if (process.env['no_proxy'] != null) { + this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); + } + this.scriptPath = (yield io.which('pwsh', false)) || (yield io.which('powershell', true)); + }); } + setupScriptBash() { + return __awaiter(this, void 0, void 0, function* () { + (0, fs_1.chmodSync)(this.escapedScript, '777'); + this.scriptArguments = []; + this.scriptPath = yield io.which(this.escapedScript, true); + }); + } + useArguments(...args) { + this.scriptArguments.push(...args); + return this; + } + useVersion(dotnetVersion, quality) { + if (dotnetVersion.type) { + this.useArguments(dotnetVersion.type, dotnetVersion.value); + } + if (quality && !dotnetVersion.qualityFlag) { + core.warning(`'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A and A.x formats where the major tag is higher than 5. You specified: ${dotnetVersion.value}. 'dotnet-quality' input is ignored.`); + return this; + } + if (quality) { + this.useArguments(utils_1.IS_WINDOWS ? '-Quality' : '--quality', quality); + } + return this; + } + execute() { + return __awaiter(this, void 0, void 0, function* () { + const getExecOutputOptions = { + ignoreReturnCode: true, + env: process.env + }; + yield this.scriptReady; + return exec.getExecOutput(`"${this.scriptPath}"`, this.scriptArguments, getExecOutputOptions); + }); + } +} +exports.DotnetInstallScript = DotnetInstallScript; +class DotnetInstallDir { static convertInstallPathToAbsolute(installDir) { let transformedPath; if (path_1.default.isAbsolute(installDir)) { @@ -335,70 +400,33 @@ class DotnetCoreInstaller { core.addPath(process.env['DOTNET_INSTALL_DIR']); core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']); } - setQuality(dotnetVersion, scriptArguments) { - const option = utils_1.IS_WINDOWS ? '-Quality' : '--quality'; - if (dotnetVersion.qualityFlag) { - scriptArguments.push(option, this.quality); - } - else { - core.warning(`'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A and A.x formats where the major tag is higher than 5. You specified: ${this.version}. 'dotnet-quality' input is ignored.`); - } + static initialize() { + process.env['DOTNET_INSTALL_DIR'] = DotnetInstallDir.path; + } +} +exports.DotnetInstallDir = DotnetInstallDir; +DotnetInstallDir.default = { + linux: '/usr/share/dotnet', + mac: path_1.default.join(process.env['HOME'] + '', '.dotnet'), + windows: path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet') +}; +DotnetInstallDir.path = process.env['DOTNET_INSTALL_DIR'] + ? DotnetInstallDir.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) + : DotnetInstallDir.default[(0, utils_1.getPlatform)()]; +class DotnetCoreInstaller { + constructor(version, quality) { + this.version = version; + this.quality = quality; } + ; installDotnet() { return __awaiter(this, void 0, void 0, function* () { - const windowsDefaultOptions = [ - '-NoLogo', - '-Sta', - '-NoProfile', - '-NonInteractive', - '-ExecutionPolicy', - 'Unrestricted', - '-Command' - ]; - const scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh'; - const escapedScript = path_1.default - .join(__dirname, '..', 'externals', scriptName) - .replace(/'/g, "''"); - let scriptArguments; - let scriptPath = ''; const versionResolver = new DotnetVersionResolver(this.version); - const dotnetVersion = yield versionResolver.createDotNetVersion(); - if (utils_1.IS_WINDOWS) { - scriptArguments = ['&', `'${escapedScript}'`]; - if (dotnetVersion.type) { - scriptArguments.push(dotnetVersion.type, dotnetVersion.value); - } - if (this.quality) { - this.setQuality(dotnetVersion, scriptArguments); - } - if (process.env['https_proxy'] != null) { - scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`); - } - // This is not currently an option - if (process.env['no_proxy'] != null) { - scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); - } - scriptPath = - (yield io.which('pwsh', false)) || (yield io.which('powershell', true)); - scriptArguments = windowsDefaultOptions.concat(scriptArguments); - } - else { - (0, fs_1.chmodSync)(escapedScript, '777'); - scriptPath = yield io.which(escapedScript, true); - scriptArguments = []; - if (dotnetVersion.type) { - scriptArguments.push(dotnetVersion.type, dotnetVersion.value); - } - if (this.quality) { - this.setQuality(dotnetVersion, scriptArguments); - } - } - // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - const getExecOutputOptions = { - ignoreReturnCode: true, - env: process.env - }; - const { exitCode, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); + const dotnetVersion = yield versionResolver.createDotnetVersion(); + const installScript = new DotnetInstallScript() + .useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files') + .useVersion(dotnetVersion, this.quality); + const { exitCode, stderr } = yield installScript.execute(); if (exitCode) { throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`); } @@ -417,17 +445,9 @@ class DotnetCoreInstaller { } } exports.DotnetCoreInstaller = DotnetCoreInstaller; -_a = DotnetCoreInstaller; +DotnetCoreInstaller.addToPath = DotnetInstallDir.addToPath; (() => { - const dotnetInstallDirDefault = { - linux: '/usr/share/dotnet', - mac: path_1.default.join(process.env['HOME'] + '', '.dotnet'), - windows: path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet') - }[(0, utils_1.getPlatform)()]; - const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR'] - ? _a.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) - : dotnetInstallDirDefault; - process.env['DOTNET_INSTALL_DIR'] = dotnetInstallDir; + DotnetInstallDir.initialize; })(); diff --git a/src/installer.ts b/src/installer.ts index b2132ef8e..31b353231 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -61,7 +61,7 @@ export class DotnetVersionResolver { return /^\d+$/.test(versionTag); } - public async createDotNetVersion(): Promise<{ + public async createDotnetVersion(): Promise<{ type: string; value: string; qualityFlag: boolean; @@ -110,29 +110,106 @@ export class DotnetVersionResolver { 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; } -export class DotnetCoreInstaller { - private version: string; - private quality: QualityOptions; +export class DotnetInstallScript { + private scriptName = IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh'; + private escapedScript: string; + private scriptArguments: string[] = []; + private scriptPath = ''; + private scriptReady: Promise; - static { - const dotnetInstallDirDefault = { - linux: '/usr/share/dotnet', - mac: path.join(process.env['HOME'] + '', '.dotnet'), - windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet') - }[getPlatform()]; + constructor() { + this.escapedScript = path + .join(__dirname, '..', 'externals', this.scriptName) + .replace(/'/g, "''"); + + this.scriptReady = IS_WINDOWS + ? this.setupScriptPowershell() + : this.setupScriptBash(); + } + + private async setupScriptPowershell() { + this.scriptArguments = [ + '-NoLogo', + '-Sta', + '-NoProfile', + '-NonInteractive', + '-ExecutionPolicy', + 'Unrestricted', + '-Command' + ]; + + this.scriptArguments.push('&', `'${this.escapedScript}'`); + + if (process.env['https_proxy'] != null) { + this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`); + } + // This is not currently an option + if (process.env['no_proxy'] != null) { + this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); + } + + this.scriptPath = (await io.which('pwsh', false)) || (await io.which('powershell', true)); + } + + private async setupScriptBash() { + chmodSync(this.escapedScript, '777'); - const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR'] - ? this.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) - : dotnetInstallDirDefault; + this.scriptArguments = []; - process.env['DOTNET_INSTALL_DIR'] = dotnetInstallDir; + this.scriptPath = await io.which(this.escapedScript, true); } - constructor(version: string, quality: QualityOptions) { - this.version = version; - this.quality = quality; + public useArguments(...args: string[]) { + this.scriptArguments.push(...args); + return this; } + public useVersion(dotnetVersion: DotnetVersion, quality?: QualityOptions) { + if (dotnetVersion.type) { + this.useArguments(dotnetVersion.type, dotnetVersion.value); + } + + if (quality && !dotnetVersion.qualityFlag) { + core.warning( + `'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A and A.x formats where the major tag is higher than 5. You specified: ${dotnetVersion.value}. 'dotnet-quality' input is ignored.` + ); + return this; + } + + if (quality) { + this.useArguments(IS_WINDOWS ? '-Quality' : '--quality', quality); + } + + return this; + } + + public async execute() { + const getExecOutputOptions = { + ignoreReturnCode: true, + env: process.env as {string: string} + }; + + await this.scriptReady; + + return exec.getExecOutput( + `"${this.scriptPath}"`, + this.scriptArguments, + getExecOutputOptions, + ) + } +} + +export abstract class DotnetInstallDir { + private static readonly default = { + linux: '/usr/share/dotnet', + mac: path.join(process.env['HOME'] + '', '.dotnet'), + windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet') + } + + public static readonly path = process.env['DOTNET_INSTALL_DIR'] + ? DotnetInstallDir.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) + : DotnetInstallDir.default[getPlatform()] + private static convertInstallPathToAbsolute(installDir: string): string { let transformedPath; if (path.isAbsolute(installDir)) { @@ -145,90 +222,35 @@ export class DotnetCoreInstaller { return path.normalize(transformedPath); } - static addToPath() { + public static addToPath() { core.addPath(process.env['DOTNET_INSTALL_DIR']!); core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']); } - private setQuality( - dotnetVersion: DotnetVersion, - scriptArguments: string[] - ): void { - const option = IS_WINDOWS ? '-Quality' : '--quality'; - if (dotnetVersion.qualityFlag) { - scriptArguments.push(option, this.quality); - } else { - core.warning( - `'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A and A.x formats where the major tag is higher than 5. You specified: ${this.version}. 'dotnet-quality' input is ignored.` - ); - } + public static initialize() { + process.env['DOTNET_INSTALL_DIR'] = DotnetInstallDir.path; } +} - public async installDotnet(): Promise { - const windowsDefaultOptions = [ - '-NoLogo', - '-Sta', - '-NoProfile', - '-NonInteractive', - '-ExecutionPolicy', - 'Unrestricted', - '-Command' - ]; - const scriptName = IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh'; - const escapedScript = path - .join(__dirname, '..', 'externals', scriptName) - .replace(/'/g, "''"); - let scriptArguments: string[]; - let scriptPath = ''; - - const versionResolver = new DotnetVersionResolver(this.version); - const dotnetVersion = await versionResolver.createDotNetVersion(); - - if (IS_WINDOWS) { - scriptArguments = ['&', `'${escapedScript}'`]; +export class DotnetCoreInstaller { + static addToPath = DotnetInstallDir.addToPath; - if (dotnetVersion.type) { - scriptArguments.push(dotnetVersion.type, dotnetVersion.value); - } + static { + DotnetInstallDir.initialize; + } - if (this.quality) { - this.setQuality(dotnetVersion, scriptArguments); - } + constructor(private version: string, private quality: QualityOptions) {}; - if (process.env['https_proxy'] != null) { - scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`); - } - // This is not currently an option - if (process.env['no_proxy'] != null) { - scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); - } + public async installDotnet(): Promise { + const versionResolver = new DotnetVersionResolver(this.version); + const dotnetVersion = await versionResolver.createDotnetVersion(); - scriptPath = - (await io.which('pwsh', false)) || (await io.which('powershell', true)); - scriptArguments = windowsDefaultOptions.concat(scriptArguments); - } else { - chmodSync(escapedScript, '777'); - scriptPath = await io.which(escapedScript, true); - scriptArguments = []; + const installScript = new DotnetInstallScript() + .useArguments(IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files') + .useVersion(dotnetVersion, this.quality); - if (dotnetVersion.type) { - scriptArguments.push(dotnetVersion.type, dotnetVersion.value); - } + const {exitCode, stderr} = await installScript.execute(); - if (this.quality) { - this.setQuality(dotnetVersion, scriptArguments); - } - } - // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used - const getExecOutputOptions = { - ignoreReturnCode: true, - env: process.env as {string: string} - }; - const {exitCode, stderr} = await exec.getExecOutput( - `"${scriptPath}"`, - scriptArguments, - getExecOutputOptions - ); if (exitCode) { throw new Error( `Failed to install dotnet, exit code: ${exitCode}. ${stderr}` From 2cbebb775a729fbfa93e447f35d0c9823393e554 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:00:39 +0200 Subject: [PATCH 04/11] Add dotnet runtime installation before main script run --- __tests__/installer.test.ts | 2 +- dist/index.js | 37 ++++++++++++++++++---- src/installer.ts | 63 +++++++++++++++++++++++++++++-------- 3 files changed, 82 insertions(+), 20 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index becedea7c..5e577c95c 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -117,7 +117,7 @@ describe('DotnetCoreInstaller tests', () => { it('Throws if no location contains correct dotnet version', async () => { await expect(async () => { - await getDotnet('1000.0.0') + await getDotnet('1000.0.0'); }).rejects.toThrow(); }, 30000); diff --git a/dist/index.js b/dist/index.js index 727b6cac7..c8dc1d313 100644 --- a/dist/index.js +++ b/dist/index.js @@ -344,7 +344,8 @@ class DotnetInstallScript { if (process.env['no_proxy'] != null) { this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); } - this.scriptPath = (yield io.which('pwsh', false)) || (yield io.which('powershell', true)); + this.scriptPath = + (yield io.which('pwsh', false)) || (yield io.which('powershell', true)); }); } setupScriptBash() { @@ -418,17 +419,41 @@ class DotnetCoreInstaller { this.version = version; this.quality = quality; } - ; installDotnet() { return __awaiter(this, void 0, void 0, function* () { const versionResolver = new DotnetVersionResolver(this.version); const dotnetVersion = yield versionResolver.createDotnetVersion(); - const installScript = new DotnetInstallScript() + /** + * Install dotnet runitme first in order to get + * the latest stable version of dotnet CLI + */ + const runtimeInstallScript = new DotnetInstallScript() + // If dotnet CLI is already installed - avoid overwriting it .useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files') + // Install only runtime + CLI + .useArguments(utils_1.IS_WINDOWS ? '-Runtime' : '--runtime', 'dotnet') + // Use latest stable version + .useArguments(utils_1.IS_WINDOWS ? '-Channel' : '--channel', 'LTS'); + const runtimeInstall = yield runtimeInstallScript.execute(); + if (runtimeInstall.exitCode) { + /** + * dotnetInstallScript will install CLI and runtime if previous script haven't succeded, + * so at this point it's too early to throw an error + */ + core.warning(`Failed to install dotnet runtime + cli, exit code: ${runtimeInstall.exitCode}. ${runtimeInstall.stderr}`); + } + /** + * Install dotnet over the latest version of + * dotnet CLI + */ + const dotnetInstallScript = new DotnetInstallScript() + // Don't overwrite CLI because it should be already installed + .useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files') + // Use version provided by user .useVersion(dotnetVersion, this.quality); - const { exitCode, stderr } = yield installScript.execute(); - if (exitCode) { - throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`); + const dotnetInstall = yield dotnetInstallScript.execute(); + if (dotnetInstall.exitCode) { + throw new Error(`Failed to install dotnet, exit code: ${dotnetInstall.exitCode}. ${dotnetInstall.stderr}`); } return this.outputDotnetVersion(dotnetVersion.value); }); diff --git a/src/installer.ts b/src/installer.ts index 31b353231..0b9f25b41 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -121,7 +121,7 @@ export class DotnetInstallScript { this.escapedScript = path .join(__dirname, '..', 'externals', this.scriptName) .replace(/'/g, "''"); - + this.scriptReady = IS_WINDOWS ? this.setupScriptPowershell() : this.setupScriptBash(); @@ -148,7 +148,8 @@ export class DotnetInstallScript { this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); } - this.scriptPath = (await io.which('pwsh', false)) || (await io.which('powershell', true)); + this.scriptPath = + (await io.which('pwsh', false)) || (await io.which('powershell', true)); } private async setupScriptBash() { @@ -194,8 +195,8 @@ export class DotnetInstallScript { return exec.getExecOutput( `"${this.scriptPath}"`, this.scriptArguments, - getExecOutputOptions, - ) + getExecOutputOptions + ); } } @@ -204,11 +205,13 @@ export abstract class DotnetInstallDir { linux: '/usr/share/dotnet', mac: path.join(process.env['HOME'] + '', '.dotnet'), windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet') - } + }; public static readonly path = process.env['DOTNET_INSTALL_DIR'] - ? DotnetInstallDir.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR']) - : DotnetInstallDir.default[getPlatform()] + ? DotnetInstallDir.convertInstallPathToAbsolute( + process.env['DOTNET_INSTALL_DIR'] + ) + : DotnetInstallDir.default[getPlatform()]; private static convertInstallPathToAbsolute(installDir: string): string { let transformedPath; @@ -239,21 +242,55 @@ export class DotnetCoreInstaller { DotnetInstallDir.initialize; } - constructor(private version: string, private quality: QualityOptions) {}; + constructor(private version: string, private quality: QualityOptions) {} public async installDotnet(): Promise { const versionResolver = new DotnetVersionResolver(this.version); const dotnetVersion = await versionResolver.createDotnetVersion(); - const installScript = new DotnetInstallScript() - .useArguments(IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files') + /** + * Install dotnet runitme first in order to get + * the latest stable version of dotnet CLI + */ + const runtimeInstallScript = new DotnetInstallScript() + // If dotnet CLI is already installed - avoid overwriting it + .useArguments( + IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files' + ) + // Install only runtime + CLI + .useArguments(IS_WINDOWS ? '-Runtime' : '--runtime', 'dotnet') + // Use latest stable version + .useArguments(IS_WINDOWS ? '-Channel' : '--channel', 'LTS'); + + const runtimeInstall = await runtimeInstallScript.execute(); + + if (runtimeInstall.exitCode) { + /** + * dotnetInstallScript will install CLI and runtime if previous script haven't succeded, + * so at this point it's too early to throw an error + */ + core.warning( + `Failed to install dotnet runtime + cli, exit code: ${runtimeInstall.exitCode}. ${runtimeInstall.stderr}` + ); + } + + /** + * Install dotnet over the latest version of + * dotnet CLI + */ + const dotnetInstallScript = new DotnetInstallScript() + // Don't overwrite CLI because it should be already installed + .useArguments( + IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files' + ) + // Use version provided by user .useVersion(dotnetVersion, this.quality); - const {exitCode, stderr} = await installScript.execute(); + const dotnetInstall = await dotnetInstallScript.execute(); - if (exitCode) { + if (dotnetInstall.exitCode) { throw new Error( - `Failed to install dotnet, exit code: ${exitCode}. ${stderr}` + `Failed to install dotnet, exit code: ${dotnetInstall.exitCode}. ${dotnetInstall.stderr}` ); } From 5176a5d07ae8f7733dd7bd087ded0f6121033701 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:10:53 +0200 Subject: [PATCH 05/11] Fix DOTNET_INSTALL_DIR enviornment variable --- src/installer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer.ts b/src/installer.ts index 0b9f25b41..e99e1a2ac 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -239,7 +239,7 @@ export class DotnetCoreInstaller { static addToPath = DotnetInstallDir.addToPath; static { - DotnetInstallDir.initialize; + DotnetInstallDir.initialize(); } constructor(private version: string, private quality: QualityOptions) {} From e476fa793407ec53d13f6bde1b3720a31f23bf80 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:11:32 +0200 Subject: [PATCH 06/11] build: Fix DOTNET_INSTALL_DIR enviornment variable --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index c8dc1d313..6d43a2c97 100644 --- a/dist/index.js +++ b/dist/index.js @@ -472,7 +472,7 @@ class DotnetCoreInstaller { exports.DotnetCoreInstaller = DotnetCoreInstaller; DotnetCoreInstaller.addToPath = DotnetInstallDir.addToPath; (() => { - DotnetInstallDir.initialize; + DotnetInstallDir.initialize(); })(); From 380d40d02a0cea1a1cb8788595e312d3a66b0d0b Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:34:18 +0200 Subject: [PATCH 07/11] Refactor convertInstallPathToAbsolute --- dist/index.js | 15 +++++---------- src/installer.ts | 17 ++++++----------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6d43a2c97..ab1c28de6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -351,7 +351,6 @@ class DotnetInstallScript { setupScriptBash() { return __awaiter(this, void 0, void 0, function* () { (0, fs_1.chmodSync)(this.escapedScript, '777'); - this.scriptArguments = []; this.scriptPath = yield io.which(this.escapedScript, true); }); } @@ -386,15 +385,11 @@ class DotnetInstallScript { exports.DotnetInstallScript = DotnetInstallScript; class DotnetInstallDir { static convertInstallPathToAbsolute(installDir) { - let transformedPath; - if (path_1.default.isAbsolute(installDir)) { - transformedPath = installDir; - } - else { - transformedPath = installDir.startsWith('~') - ? path_1.default.join(os_1.default.homedir(), installDir.slice(1)) - : (transformedPath = path_1.default.join(process.cwd(), installDir)); - } + if (path_1.default.isAbsolute(installDir)) + return path_1.default.normalize(installDir); + const transformedPath = installDir.startsWith('~') + ? path_1.default.join(os_1.default.homedir(), installDir.slice(1)) + : path_1.default.join(process.cwd(), installDir); return path_1.default.normalize(transformedPath); } static addToPath() { diff --git a/src/installer.ts b/src/installer.ts index e99e1a2ac..44610435f 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -154,9 +154,6 @@ export class DotnetInstallScript { private async setupScriptBash() { chmodSync(this.escapedScript, '777'); - - this.scriptArguments = []; - this.scriptPath = await io.which(this.escapedScript, true); } @@ -214,14 +211,12 @@ export abstract class DotnetInstallDir { : DotnetInstallDir.default[getPlatform()]; private static convertInstallPathToAbsolute(installDir: string): string { - let transformedPath; - if (path.isAbsolute(installDir)) { - transformedPath = installDir; - } else { - transformedPath = installDir.startsWith('~') - ? path.join(os.homedir(), installDir.slice(1)) - : (transformedPath = path.join(process.cwd(), installDir)); - } + if (path.isAbsolute(installDir)) return path.normalize(installDir); + + const transformedPath = installDir.startsWith('~') + ? path.join(os.homedir(), installDir.slice(1)) + : path.join(process.cwd(), installDir); + return path.normalize(transformedPath); } From 2896a443183e55069ca89161fe856cba012ccdef Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:56:03 +0200 Subject: [PATCH 08/11] Update e2e tests --- .github/workflows/e2e-tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 9963bbc97..58817ddf5 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -320,3 +320,33 @@ jobs: - name: Verify dotnet shell: pwsh run: __tests__/verify-dotnet.ps1 -Patterns "^3.1.201$" -CheckNugetConfig + + test-sequential-version-installation: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Clear toolcache + shell: pwsh + run: __tests__/clear-toolcache.ps1 ${{ runner.os }} + # Install one version, use it for something, then switch to next version + - name: Setup dotnet 2.2.402 + uses: ./ + with: + dotnet-version: 2.2.402 + - name: Verify dotnet 2.2.402 + shell: pwsh + run: __tests__/verify-dotnet.ps1 -Patterns "^2.2.402$" + - name: Setup dotnet 7.0.203 + uses: ./ + with: + dotnet-version: 7.0.203 + - name: Verify dotnet 7.0.203 + shell: pwsh + run: __tests__/verify-dotnet.ps1 -Patterns "^7.0.203$" + + From 323d590616d678b93c548c269bcd85b8f168b578 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 17:56:45 +0200 Subject: [PATCH 09/11] Format: Update e2e tests --- .github/workflows/e2e-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 58817ddf5..8ca6c14ca 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -348,5 +348,3 @@ jobs: - name: Verify dotnet 7.0.203 shell: pwsh run: __tests__/verify-dotnet.ps1 -Patterns "^7.0.203$" - - From 6a20211df42526f5639b050264aab3225e5f21c2 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 18:22:11 +0200 Subject: [PATCH 10/11] Add more comprehensive testing --- .github/workflows/e2e-tests.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 8ca6c14ca..ce5a26dc1 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -327,6 +327,8 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] + lower-version: ['2.2.402', '3.0.103', '3.1.426', '6.0.408', '7.0.100'] + higher-version: ['6.0.408', '7.0.203'] steps: - name: Checkout uses: actions/checkout@v3 @@ -334,17 +336,17 @@ jobs: shell: pwsh run: __tests__/clear-toolcache.ps1 ${{ runner.os }} # Install one version, use it for something, then switch to next version - - name: Setup dotnet 2.2.402 + - name: Setup dotnet (lower version) uses: ./ with: - dotnet-version: 2.2.402 - - name: Verify dotnet 2.2.402 + dotnet-version: ${{ matrix.lower-version }} + - name: Verify dotnet (lower version) shell: pwsh - run: __tests__/verify-dotnet.ps1 -Patterns "^2.2.402$" - - name: Setup dotnet 7.0.203 + run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$" + - name: Setup dotnet (higher version) uses: ./ with: - dotnet-version: 7.0.203 - - name: Verify dotnet 7.0.203 + dotnet-version: ${{ matrix.higher-version }} + - name: Verify dotnet (higher version) shell: pwsh - run: __tests__/verify-dotnet.ps1 -Patterns "^7.0.203$" + run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.higher-version }}$" From 4fd06c4bfd7bf154b33270be6f724d8bf8c3c66c Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 18:38:20 +0200 Subject: [PATCH 11/11] Fix e2e tests --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index ce5a26dc1..e23e2b98f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -349,4 +349,4 @@ jobs: dotnet-version: ${{ matrix.higher-version }} - name: Verify dotnet (higher version) shell: pwsh - run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.higher-version }}$" + run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$"