mirror of
https://github.com/actions/runner.git
synced 2026-03-16 22:18:10 +08:00
Compare commits
1 Commits
salmanmkc/
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c985a9ff03 |
@@ -4,7 +4,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
|
||||
"ghcr.io/devcontainers/features/dotnet": {
|
||||
"version": "8.0.418"
|
||||
"version": "8.0.419"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "20"
|
||||
|
||||
@@ -195,16 +195,8 @@ namespace GitHub.Runner.Common
|
||||
public static readonly string RequireNode24Flag = "actions.runner.requirenode24";
|
||||
public static readonly string WarnOnNode20Flag = "actions.runner.warnonnode20";
|
||||
|
||||
// Feature flags for Linux ARM32 deprecation
|
||||
public static readonly string DeprecateLinuxArm32Flag = "actions_runner_deprecate_linux_arm32";
|
||||
public static readonly string KillLinuxArm32Flag = "actions_runner_kill_linux_arm32";
|
||||
|
||||
// Blog post URL for Node 20 deprecation
|
||||
public static readonly string Node20DeprecationUrl = "https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/";
|
||||
|
||||
// Linux ARM32 deprecation date (TBD - placeholder for October 2026)
|
||||
public static readonly string LinuxArm32DeprecationDate = "October 2026";
|
||||
public static readonly string LinuxArm32DeprecationMessage = "Linux ARM32 runners are deprecated and will no longer be supported after {0}. Please migrate to a supported platform.";
|
||||
}
|
||||
|
||||
public static readonly string InternalTelemetryIssueDataKey = "_internal_telemetry";
|
||||
|
||||
@@ -108,48 +108,14 @@ namespace GitHub.Runner.Common.Util
|
||||
|
||||
/// <summary>
|
||||
/// Checks if Node24 is requested but running on ARM32 Linux, and determines if fallback is needed.
|
||||
/// Also handles ARM32 deprecation and kill switch phases.
|
||||
/// </summary>
|
||||
/// <param name="preferredVersion">The preferred Node version</param>
|
||||
/// <param name="deprecateArm32">Feature flag indicating ARM32 Linux is deprecated</param>
|
||||
/// <param name="killArm32">Feature flag indicating ARM32 Linux should no longer work</param>
|
||||
/// <returns>A tuple containing the adjusted node version and an optional warning message</returns>
|
||||
public static (string nodeVersion, string warningMessage) CheckNodeVersionForLinuxArm32(
|
||||
string preferredVersion,
|
||||
bool deprecateArm32 = false,
|
||||
bool killArm32 = false)
|
||||
public static (string nodeVersion, string warningMessage) CheckNodeVersionForLinuxArm32(string preferredVersion)
|
||||
{
|
||||
bool isArm32Linux = Constants.Runner.PlatformArchitecture.Equals(Constants.Architecture.Arm) &&
|
||||
Constants.Runner.Platform.Equals(Constants.OSPlatform.Linux);
|
||||
|
||||
if (!isArm32Linux)
|
||||
{
|
||||
return (preferredVersion, null);
|
||||
}
|
||||
|
||||
// ARM32 kill switch: runner should no longer work on this platform
|
||||
if (killArm32)
|
||||
{
|
||||
return (null, "Linux ARM32 runners are no longer supported. Please migrate to a supported platform.");
|
||||
}
|
||||
|
||||
// ARM32 deprecation warning: continue using node20 but warn about upcoming end of support
|
||||
if (deprecateArm32)
|
||||
{
|
||||
string deprecationWarning = string.Format(
|
||||
Constants.Runner.NodeMigration.LinuxArm32DeprecationMessage,
|
||||
Constants.Runner.NodeMigration.LinuxArm32DeprecationDate);
|
||||
|
||||
if (string.Equals(preferredVersion, Constants.Runner.NodeMigration.Node24, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return (Constants.Runner.NodeMigration.Node20, deprecationWarning);
|
||||
}
|
||||
|
||||
return (preferredVersion, deprecationWarning);
|
||||
}
|
||||
|
||||
// Legacy behavior: fall back to node20 if node24 was requested on ARM32
|
||||
if (string.Equals(preferredVersion, Constants.Runner.NodeMigration.Node24, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(preferredVersion, Constants.Runner.NodeMigration.Node24, StringComparison.OrdinalIgnoreCase) &&
|
||||
Constants.Runner.PlatformArchitecture.Equals(Constants.Architecture.Arm) &&
|
||||
Constants.Runner.Platform.Equals(Constants.OSPlatform.Linux))
|
||||
{
|
||||
return (Constants.Runner.NodeMigration.Node20, "Node 24 is not supported on Linux ARM32 platforms. Falling back to Node 20.");
|
||||
}
|
||||
|
||||
@@ -854,12 +854,6 @@ namespace GitHub.Runner.Worker
|
||||
// Track Node.js 20 actions for deprecation warning
|
||||
Global.DeprecatedNode20Actions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Track actions upgraded from Node.js 20 to Node.js 24
|
||||
Global.UpgradedToNode24Actions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Track actions stuck on Node.js 20 due to ARM32 (separate from general deprecation)
|
||||
Global.Arm32Node20Actions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// Job Outputs
|
||||
JobOutputs = new Dictionary<string, VariableValue>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
|
||||
@@ -34,7 +34,5 @@ namespace GitHub.Runner.Worker
|
||||
public bool HasDeprecatedSetOutput { get; set; }
|
||||
public bool HasDeprecatedSaveState { get; set; }
|
||||
public HashSet<string> DeprecatedNode20Actions { get; set; }
|
||||
public HashSet<string> UpgradedToNode24Actions { get; set; }
|
||||
public HashSet<string> Arm32Node20Actions { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,9 +65,19 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
nodeData.NodeVersion = Common.Constants.Runner.NodeMigration.Node20;
|
||||
}
|
||||
|
||||
// Read flags early; actionName is also resolved up front for tracking after version is determined
|
||||
bool warnOnNode20 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.WarnOnNode20Flag) ?? false;
|
||||
string actionName = GetActionName(action);
|
||||
// Track Node.js 20 actions for deprecation annotation
|
||||
if (string.Equals(nodeData.NodeVersion, Constants.Runner.NodeMigration.Node20, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
bool warnOnNode20 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.WarnOnNode20Flag) ?? false;
|
||||
if (warnOnNode20)
|
||||
{
|
||||
string actionName = GetActionName(action);
|
||||
if (!string.IsNullOrEmpty(actionName))
|
||||
{
|
||||
executionContext.Global.DeprecatedNode20Actions?.Add(actionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if node20 was explicitly specified in the action
|
||||
// We don't modify if node24 was explicitly specified
|
||||
@@ -75,19 +85,9 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
{
|
||||
bool useNode24ByDefault = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.UseNode24ByDefaultFlag) ?? false;
|
||||
bool requireNode24 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.RequireNode24Flag) ?? false;
|
||||
bool deprecateArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.DeprecateLinuxArm32Flag) ?? false;
|
||||
bool killArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.KillLinuxArm32Flag) ?? false;
|
||||
|
||||
var (nodeVersion, configWarningMessage) = NodeUtil.DetermineActionsNodeVersion(environment, useNode24ByDefault, requireNode24);
|
||||
var (finalNodeVersion, platformWarningMessage) = NodeUtil.CheckNodeVersionForLinuxArm32(nodeVersion, deprecateArm32, killArm32);
|
||||
|
||||
// ARM32 kill switch: fail the step
|
||||
if (finalNodeVersion == null)
|
||||
{
|
||||
executionContext.Error(platformWarningMessage);
|
||||
throw new InvalidOperationException(platformWarningMessage);
|
||||
}
|
||||
|
||||
var (finalNodeVersion, platformWarningMessage) = NodeUtil.CheckNodeVersionForLinuxArm32(nodeVersion);
|
||||
nodeData.NodeVersion = finalNodeVersion;
|
||||
|
||||
if (!string.IsNullOrEmpty(configWarningMessage))
|
||||
@@ -100,26 +100,6 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
executionContext.Warning(platformWarningMessage);
|
||||
}
|
||||
|
||||
// Track actions based on their final node version
|
||||
if (!string.IsNullOrEmpty(actionName))
|
||||
{
|
||||
if (string.Equals(finalNodeVersion, Constants.Runner.NodeMigration.Node24, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Action was upgraded from node20 to node24
|
||||
executionContext.Global.UpgradedToNode24Actions?.Add(actionName);
|
||||
}
|
||||
else if (deprecateArm32 && string.Equals(finalNodeVersion, Constants.Runner.NodeMigration.Node20, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Action is on node20 because ARM32 can't run node24
|
||||
executionContext.Global.Arm32Node20Actions?.Add(actionName);
|
||||
}
|
||||
else if (warnOnNode20)
|
||||
{
|
||||
// Action is still running on node20 (general case)
|
||||
executionContext.Global.DeprecatedNode20Actions?.Add(actionName);
|
||||
}
|
||||
}
|
||||
|
||||
// Show information about Node 24 migration in Phase 2
|
||||
if (useNode24ByDefault && !requireNode24 && string.Equals(finalNodeVersion, Constants.Runner.NodeMigration.Node24, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -129,15 +109,6 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
executionContext.Output(infoMessage);
|
||||
}
|
||||
}
|
||||
else if (warnOnNode20 && string.Equals(nodeData.NodeVersion, Constants.Runner.NodeMigration.Node20, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
// This handles the case where nodeData.NodeVersion is still node20 but wasn't caught above
|
||||
// (shouldn't normally happen, but kept for safety)
|
||||
if (!string.IsNullOrEmpty(actionName))
|
||||
{
|
||||
executionContext.Global.DeprecatedNode20Actions?.Add(actionName);
|
||||
}
|
||||
}
|
||||
|
||||
(handler as INodeScriptActionHandler).Data = nodeData;
|
||||
}
|
||||
|
||||
@@ -58,17 +58,8 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
|
||||
public Task<string> DetermineNodeRuntimeVersion(IExecutionContext executionContext, string preferredVersion)
|
||||
{
|
||||
bool deprecateArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.DeprecateLinuxArm32Flag) ?? false;
|
||||
bool killArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.KillLinuxArm32Flag) ?? false;
|
||||
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32, killArm32);
|
||||
|
||||
if (nodeVersion == null)
|
||||
{
|
||||
executionContext.Error(warningMessage);
|
||||
throw new InvalidOperationException(warningMessage);
|
||||
}
|
||||
|
||||
// Use NodeUtil to check if Node24 is requested but we're on ARM32 Linux
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion);
|
||||
if (!string.IsNullOrEmpty(warningMessage))
|
||||
{
|
||||
executionContext.Warning(warningMessage);
|
||||
@@ -151,17 +142,8 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
|
||||
public async Task<string> DetermineNodeRuntimeVersion(IExecutionContext executionContext, string preferredVersion)
|
||||
{
|
||||
bool deprecateArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.DeprecateLinuxArm32Flag) ?? false;
|
||||
bool killArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.KillLinuxArm32Flag) ?? false;
|
||||
|
||||
var (nodeExternal, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32, killArm32);
|
||||
|
||||
if (nodeExternal == null)
|
||||
{
|
||||
executionContext.Error(warningMessage);
|
||||
throw new InvalidOperationException(warningMessage);
|
||||
}
|
||||
|
||||
// Use NodeUtil to check if Node24 is requested but we're on ARM32 Linux
|
||||
var (nodeExternal, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion);
|
||||
if (!string.IsNullOrEmpty(warningMessage))
|
||||
{
|
||||
executionContext.Warning(warningMessage);
|
||||
@@ -291,17 +273,8 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
|
||||
private string CheckPlatformForAlpineContainer(IExecutionContext executionContext, string preferredVersion)
|
||||
{
|
||||
bool deprecateArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.DeprecateLinuxArm32Flag) ?? false;
|
||||
bool killArm32 = executionContext.Global.Variables?.GetBoolean(Constants.Runner.NodeMigration.KillLinuxArm32Flag) ?? false;
|
||||
|
||||
var (nodeExternal, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32, killArm32);
|
||||
|
||||
if (nodeExternal == null)
|
||||
{
|
||||
executionContext.Error(warningMessage);
|
||||
throw new InvalidOperationException(warningMessage);
|
||||
}
|
||||
|
||||
// Use NodeUtil to check if Node24 is requested but we're on ARM32 Linux
|
||||
var (nodeExternal, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion);
|
||||
if (!string.IsNullOrEmpty(warningMessage))
|
||||
{
|
||||
executionContext.Warning(warningMessage);
|
||||
|
||||
@@ -736,7 +736,7 @@ namespace GitHub.Runner.Worker
|
||||
}
|
||||
}
|
||||
|
||||
// Add deprecation warning annotation for Node.js 20 actions (Phase 1 - actions still running on node20)
|
||||
// Add deprecation warning annotation for Node.js 20 actions
|
||||
if (context.Global.DeprecatedNode20Actions?.Count > 0)
|
||||
{
|
||||
var sortedActions = context.Global.DeprecatedNode20Actions.OrderBy(a => a, StringComparer.OrdinalIgnoreCase);
|
||||
@@ -744,24 +744,6 @@ namespace GitHub.Runner.Worker
|
||||
var deprecationMessage = $"Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: {actionsList}. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: {Constants.Runner.NodeMigration.Node20DeprecationUrl}";
|
||||
context.Warning(deprecationMessage);
|
||||
}
|
||||
|
||||
// Add annotation for actions upgraded from Node.js 20 to Node.js 24 (Phase 2/3)
|
||||
if (context.Global.UpgradedToNode24Actions?.Count > 0)
|
||||
{
|
||||
var sortedActions = context.Global.UpgradedToNode24Actions.OrderBy(a => a, StringComparer.OrdinalIgnoreCase);
|
||||
var actionsList = string.Join(", ", sortedActions);
|
||||
var upgradeMessage = $"Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: {actionsList}. For more information see: {Constants.Runner.NodeMigration.Node20DeprecationUrl}";
|
||||
context.Warning(upgradeMessage);
|
||||
}
|
||||
|
||||
// Add annotation for ARM32 actions stuck on Node.js 20 (ARM32 can't run node24)
|
||||
if (context.Global.Arm32Node20Actions?.Count > 0)
|
||||
{
|
||||
var sortedActions = context.Global.Arm32Node20Actions.OrderBy(a => a, StringComparer.OrdinalIgnoreCase);
|
||||
var actionsList = string.Join(", ", sortedActions);
|
||||
var arm32Message = $"The following actions are running on Node.js 20 because Node.js 24 is not available on Linux ARM32: {actionsList}. Linux ARM32 runners are deprecated and will no longer be supported after {Constants.Runner.NodeMigration.LinuxArm32DeprecationDate}. Please migrate to a supported platform. For more information see: {Constants.Runner.NodeMigration.Node20DeprecationUrl}";
|
||||
context.Warning(arm32Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -370,124 +370,5 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
Assert.Contains("./.github/actions/my-action", deprecatedActions);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void Node20Action_TrackedAsUpgradedWhenUseNode24ByDefaultEnabled()
|
||||
{
|
||||
using (TestHostContext hc = CreateTestContext())
|
||||
{
|
||||
// Arrange.
|
||||
var hf = new HandlerFactory();
|
||||
hf.Initialize(hc);
|
||||
|
||||
var variables = new Dictionary<string, VariableValue>
|
||||
{
|
||||
{ Constants.Runner.NodeMigration.WarnOnNode20Flag, new VariableValue("true") },
|
||||
{ Constants.Runner.NodeMigration.UseNode24ByDefaultFlag, new VariableValue("true") }
|
||||
};
|
||||
Variables serverVariables = new(hc, variables);
|
||||
var deprecatedActions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
var upgradedActions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
_ec.Setup(x => x.Global).Returns(new GlobalContext()
|
||||
{
|
||||
Variables = serverVariables,
|
||||
EnvironmentVariables = new Dictionary<string, string>(),
|
||||
DeprecatedNode20Actions = deprecatedActions,
|
||||
UpgradedToNode24Actions = upgradedActions
|
||||
});
|
||||
|
||||
var actionRef = new RepositoryPathReference
|
||||
{
|
||||
Name = "actions/checkout",
|
||||
Ref = "v4"
|
||||
};
|
||||
|
||||
// Act.
|
||||
var data = new NodeJSActionExecutionData();
|
||||
data.NodeVersion = "node20";
|
||||
var handler = hf.Create(
|
||||
_ec.Object,
|
||||
actionRef,
|
||||
new Mock<IStepHost>().Object,
|
||||
data,
|
||||
new Dictionary<string, string>(),
|
||||
new Dictionary<string, string>(),
|
||||
new Variables(hc, new Dictionary<string, VariableValue>()),
|
||||
"",
|
||||
new List<JobExtensionRunner>()
|
||||
) as INodeScriptActionHandler;
|
||||
|
||||
// On non-ARM32 platforms, action should be upgraded to node24
|
||||
// and tracked in UpgradedToNode24Actions, NOT in DeprecatedNode20Actions
|
||||
bool isArm32Linux = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture == System.Runtime.InteropServices.Architecture.Arm &&
|
||||
System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux);
|
||||
|
||||
if (!isArm32Linux)
|
||||
{
|
||||
Assert.Equal("node24", handler.Data.NodeVersion);
|
||||
Assert.Contains("actions/checkout@v4", upgradedActions);
|
||||
Assert.DoesNotContain("actions/checkout@v4", deprecatedActions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void Node20Action_NotUpgradedWhenPhase1Only()
|
||||
{
|
||||
using (TestHostContext hc = CreateTestContext())
|
||||
{
|
||||
// Arrange.
|
||||
var hf = new HandlerFactory();
|
||||
hf.Initialize(hc);
|
||||
|
||||
var variables = new Dictionary<string, VariableValue>
|
||||
{
|
||||
{ Constants.Runner.NodeMigration.WarnOnNode20Flag, new VariableValue("true") }
|
||||
};
|
||||
Variables serverVariables = new(hc, variables);
|
||||
var deprecatedActions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
var upgradedActions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
_ec.Setup(x => x.Global).Returns(new GlobalContext()
|
||||
{
|
||||
Variables = serverVariables,
|
||||
EnvironmentVariables = new Dictionary<string, string>(),
|
||||
DeprecatedNode20Actions = deprecatedActions,
|
||||
UpgradedToNode24Actions = upgradedActions
|
||||
});
|
||||
|
||||
var actionRef = new RepositoryPathReference
|
||||
{
|
||||
Name = "actions/checkout",
|
||||
Ref = "v4"
|
||||
};
|
||||
|
||||
// Act.
|
||||
var data = new NodeJSActionExecutionData();
|
||||
data.NodeVersion = "node20";
|
||||
var handler = hf.Create(
|
||||
_ec.Object,
|
||||
actionRef,
|
||||
new Mock<IStepHost>().Object,
|
||||
data,
|
||||
new Dictionary<string, string>(),
|
||||
new Dictionary<string, string>(),
|
||||
new Variables(hc, new Dictionary<string, VariableValue>()),
|
||||
"",
|
||||
new List<JobExtensionRunner>()
|
||||
) as INodeScriptActionHandler;
|
||||
|
||||
// In Phase 1 (no UseNode24ByDefault), action stays on node20
|
||||
// and should be in DeprecatedNode20Actions
|
||||
Assert.Equal("node20", handler.Data.NodeVersion);
|
||||
Assert.Contains("actions/checkout@v4", deprecatedActions);
|
||||
Assert.Empty(upgradedActions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,107 +59,5 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
Assert.Equal("node20", nodeVersion);
|
||||
Assert.Null(warningMessage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void CheckNodeVersionForArm32_DeprecationFlagShowsWarning()
|
||||
{
|
||||
string preferredVersion = "node24";
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32: true);
|
||||
|
||||
bool isArm32 = RuntimeInformation.ProcessArchitecture == Architecture.Arm ||
|
||||
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")?.Contains("ARM") == true;
|
||||
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
|
||||
if (isArm32 && isLinux)
|
||||
{
|
||||
Assert.Equal("node20", nodeVersion);
|
||||
Assert.NotNull(warningMessage);
|
||||
Assert.Contains("deprecated", warningMessage);
|
||||
Assert.Contains("no longer be supported", warningMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal("node24", nodeVersion);
|
||||
Assert.Null(warningMessage);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void CheckNodeVersionForArm32_DeprecationFlagWithNode20PassesThrough()
|
||||
{
|
||||
// Even with deprecation flag, node20 should pass through (not downgraded further)
|
||||
string preferredVersion = "node20";
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32: true);
|
||||
|
||||
bool isArm32 = RuntimeInformation.ProcessArchitecture == Architecture.Arm ||
|
||||
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")?.Contains("ARM") == true;
|
||||
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
|
||||
if (isArm32 && isLinux)
|
||||
{
|
||||
Assert.Equal("node20", nodeVersion);
|
||||
Assert.NotNull(warningMessage);
|
||||
Assert.Contains("deprecated", warningMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal("node20", nodeVersion);
|
||||
Assert.Null(warningMessage);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void CheckNodeVersionForArm32_KillFlagReturnsNull()
|
||||
{
|
||||
string preferredVersion = "node24";
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, killArm32: true);
|
||||
|
||||
bool isArm32 = RuntimeInformation.ProcessArchitecture == Architecture.Arm ||
|
||||
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")?.Contains("ARM") == true;
|
||||
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
|
||||
if (isArm32 && isLinux)
|
||||
{
|
||||
Assert.Null(nodeVersion);
|
||||
Assert.NotNull(warningMessage);
|
||||
Assert.Contains("no longer supported", warningMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal("node24", nodeVersion);
|
||||
Assert.Null(warningMessage);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Level", "L0")]
|
||||
[Trait("Category", "Worker")]
|
||||
public void CheckNodeVersionForArm32_KillTakesPrecedenceOverDeprecation()
|
||||
{
|
||||
string preferredVersion = "node20";
|
||||
var (nodeVersion, warningMessage) = Common.Util.NodeUtil.CheckNodeVersionForLinuxArm32(preferredVersion, deprecateArm32: true, killArm32: true);
|
||||
|
||||
bool isArm32 = RuntimeInformation.ProcessArchitecture == Architecture.Arm ||
|
||||
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")?.Contains("ARM") == true;
|
||||
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
|
||||
if (isArm32 && isLinux)
|
||||
{
|
||||
Assert.Null(nodeVersion);
|
||||
Assert.NotNull(warningMessage);
|
||||
Assert.Contains("no longer supported", warningMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal("node20", nodeVersion);
|
||||
Assert.Null(warningMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ LAYOUT_DIR="$SCRIPT_DIR/../_layout"
|
||||
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
|
||||
PACKAGE_DIR="$SCRIPT_DIR/../_package"
|
||||
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
|
||||
DOTNETSDK_VERSION="8.0.418"
|
||||
DOTNETSDK_VERSION="8.0.419"
|
||||
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
|
||||
RUNNER_VERSION=$(cat runnerversion)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "8.0.418"
|
||||
"version": "8.0.419"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user