Skip to content

Commit

Permalink
[macOS] add node to software report macOS 13 arm64 (actions#8603)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey Ayupov <“[email protected]”>
  • Loading branch information
Alexey-Ayupov and Alexey Ayupov authored Oct 19, 2023
1 parent 10d8554 commit 9a9a185
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
10 changes: 4 additions & 6 deletions images/macos/software-report/SoftwareReport.Generator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
$languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion))
}
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
if ((-not $os.IsVentura) -and (-not $os.IsVenturaArm64)) {
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion))
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
$languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion))
$languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+')
}
Expand Down Expand Up @@ -211,11 +211,9 @@ $browsers.AddNode($(Build-BrowserWebdriversEnvironmentTable))
$java = $installedSoftware.AddHeader("Java")
$java.AddTable($(Get-JavaVersions))

if (-not $os.IsVenturaArm64) {
# Toolcache
$toolcache = $installedSoftware.AddHeader("Cached Tools")
$toolcache.AddNodes($(Build-ToolcacheSection))
}
# Toolcache
$toolcache = $installedSoftware.AddHeader("Cached Tools")
$toolcache.AddNodes($(Build-ToolcacheSection))

# Rust
$rust = $installedSoftware.AddHeader("Rust Tools")
Expand Down
22 changes: 16 additions & 6 deletions images/macos/software-report/SoftwareReport.Toolcache.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,24 @@ function Get-ToolcacheGoVersions {
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
}

function Build-ToolcacheSection {
return @(
[ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List"),
[ToolVersionsListNode]::new("Python", $(Get-ToolcachePythonVersions), '^\d+\.\d+', "List"),
[ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List"),
function Build-ToolcacheSection {

$nodes = @()

if (-not $os.IsVenturaArm64) {
$nodes += @(
[ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List"),
[ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List")
)
}

$nodes += @(
[ToolVersionsListNode]::new("Python", $(Get-ToolcachePythonVersions), '^\d+\.\d+', "List"),
[ToolVersionsListNode]::new("Node.js", $(Get-ToolcacheNodeVersions), '^\d+', "List"),
[ToolVersionsListNode]::new("Go", $(Get-ToolcacheGoVersions), '^\d+\.\d+', "List")
)

return $nodes
}

function Get-PowerShellModules {
Expand All @@ -50,4 +60,4 @@ function Get-PowerShellModules {
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
return [ToolVersionsListNode]::new($moduleName, $moduleVersions, '^\d+', "Inline")
}
}
}

0 comments on commit 9a9a185

Please sign in to comment.