Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/workflows/Pester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ name: Pester Tests

on:
push:
branches:
- main
- dev
- master
branches: ["dev", "main"]
pull_request:
branches:
- main
- dev
- master
branches: ["dev"]
workflow_dispatch:

jobs:
Expand All @@ -20,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest, ubuntu-latest, macos-latest, macos-26-intel]
shell: [pwsh]
include:
- os: windows-latest
Expand All @@ -30,6 +24,8 @@ jobs:
shell: powershell
- os: macos-latest
shell: powershell
- os: macos-26-intel
shell: powershell

defaults:
run:
Expand All @@ -39,17 +35,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v6
with:
dotnet-version: "8.0.x"
- name: Restore dependencies
run: dotnet restore ./Sources
- name: Build the library for MacOS
- name: Build the library for MacOS ARM64
run: dotnet publish ./Sources -c Release -r osx-arm64
if: matrix.os == 'macos-latest'
- name: Copy the library for MacOS
- name: Copy the library for MacOS ARM64
run: Copy-Item -Path ./Sources/bin/Release/netstandard2.0/osx-arm64/publish/* -Destination ./AsBuiltReport.Chart/Src/Assemblies/Core/mac-osx/osx-arm64 -Recurse
if: matrix.os == 'macos-latest'
- name: Build the library for MacOS Intel
run: dotnet publish ./Sources -c Release -r osx-x64
if: matrix.os == 'macos-26-intel'
- name: Copy the library for MacOS Intel
run: Copy-Item -Path ./Sources/bin/Release/netstandard2.0/osx-x64/publish/* -Destination ./AsBuiltReport.Chart/Src/Assemblies/Core/mac-osx/osx-x64 -Recurse
if: matrix.os == 'macos-26-intel'
- name: Build the library for Linux
run: dotnet publish ./Sources -c Release -r linux-x64
if: matrix.os == 'ubuntu-latest'
Expand All @@ -75,10 +77,6 @@ jobs:
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

- name: Install Pester
run: |
Install-Module -Name Pester -MinimumVersion 5.0.0 -Repository PSGallery -Force -AllowClobber -Scope CurrentUser

- name: Run Pester Tests
run: |
$CodeCoverageParam = @{}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v6
with:
dotnet-version: "8.0.x"
- name: Restore dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v11
with:
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
days-before-stale: 60
Expand Down
2 changes: 1 addition & 1 deletion AsBuiltReport.Chart/AsBuiltReport.Chart.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Chart.psm1'

# Version number of this module.
ModuleVersion = '0.3.4'
ModuleVersion = '0.3.5'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
69 changes: 45 additions & 24 deletions AsBuiltReport.Chart/AsBuiltReport.Chart.psm1
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
# Get assemblies files and import them
switch ($PSVersionTable.PSEdition) {
'Core' {
if ($IsMacOS) {
$architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
if ($architecture -eq "Arm64" -or $architecture -eq "Arm") {
Write-Verbose "Architecture: ARM (Apple Silicon)"
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
function Get-ChartAssemblyPath {
$separator = [System.IO.Path]::DirectorySeparatorChar
$assemblyRoot = "$PSScriptRoot{0}Src{0}Assemblies" -f $separator

} elseif ($architecture -eq "X64" -or $architecture -eq "X86") {
Write-Verbose "Architecture: x86 (Intel)"
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
switch ($PSVersionTable.PSEdition) {
'Core' {
if ($IsMacOS) {
$architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture

} else {
Write-Verbose "Architecture: Unknown or other architecture"
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
if ($architecture -in @('Arm64', 'Arm')) {
Write-Verbose 'Architecture: ARM (Apple Silicon)'
$path = "$assemblyRoot{0}Core{0}mac-osx{0}osx-arm64{0}AsBuiltReportChart.dll" -f $separator
}
elseif ($architecture -in @('X64', 'X86')) {
Write-Verbose 'Architecture: x86 (Intel)'
$path = "$assemblyRoot{0}Core{0}mac-osx{0}osx-x64{0}AsBuiltReportChart.dll" -f $separator
}
else {
throw "Unsupported macOS architecture '$architecture'. Supported architectures: Arm64, X64, X86."
}
}
elseif ($IsLinux) {
Write-Verbose 'Architecture: Linux x64'
$path = "$assemblyRoot{0}Core{0}linux-x64{0}AsBuiltReportChart.dll" -f $separator
}
elseif ($IsWindows) {
Write-Verbose 'Architecture: Windows x64'
$path = "$assemblyRoot{0}Core{0}windows-x64{0}AsBuiltReportChart.dll" -f $separator
}
else {
throw 'Unable to determine a supported platform for the Core PowerShell edition.'
}
} elseif ($IsLinux) {
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}linux-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
} elseif ($IsWindows) {
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Core{0}windows-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
}
'Desktop' {
Write-Verbose 'Architecture: Windows x64 (PowerShell 5.1)'
$path = "$assemblyRoot{0}Desktop{0}windows-x64{0}AsBuiltReportChart.dll" -f $separator
}
default {
throw "Unsupported PowerShell edition '$($PSVersionTable.PSEdition)'. Supported editions: Core, Desktop."
}
}
'Desktop' {
Import-Module ("$PSScriptRoot{0}Src{0}Assemblies{0}Desktop{0}windows-x64{0}AsBuiltReportChart.dll" -f [System.IO.Path]::DirectorySeparatorChar)
}
default {
Write-Verbose -Message 'Unable to find compatible assemblies.'

if (-not (Test-Path -LiteralPath $path)) {
throw "Unable to locate the AsBuiltReportChart assembly for this environment: $path"
}
}

return $path
}

$assemblyPath = Get-ChartAssemblyPath
Import-Module -Name $assemblyPath -Force
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.5] - Unreleased

### Added

- Add SkiaSharp.NativeAssets.macOS dependency to the module to support macOS platform
- Add support for macOS intel in the Pester workflow to test the module on macOS intel platform
- Add Pester test for missing OutputFolderPath in New-PieChart

### Changed

- Update module v0.3.5
- Update Pester workflow to use the latest version of the Pester module
- Update workflows to use the latest action version
- Enhance Get-ChartAssemblyPath function for better architecture handling

## [0.3.4] - 2026-06-25

### Changed
Expand Down
3 changes: 2 additions & 1 deletion Sources/AsBuiltReportChart.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<!-- <OutputType>Exe</OutputType> -->
<Version>0.3.4</Version>
<Version>0.3.5</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,6 +12,7 @@
<PackageReference Include="ScottPlot" Version="5.1.59" />
<PackageReference Include="SkiaSharp" Version="3.119.4" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.4" />
<PackageReference Include="SkiaSharp.NativeAssets.macOS" Version="3.119.4" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion Sources/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ internal static void Reset()
LabelBold = false;
LabelYAxis = "Count";
LabelXAxis = "Values";
_labelDistance = 0.6;
LabelDistance = 0.6;
AreaOrientation = Orientations.Vertical;
_areaExplodeFraction = 0;
EnableLegend = false;
Expand Down Expand Up @@ -482,6 +482,7 @@ internal static void Reset()
WatermarkColor = BasicColors.Gray;
_watermarkOpacity = 0.3;
DonutFraction = 0.5;
DonutCenterText = null;
HideValues = false;
SpokesLength = 10;
}
Expand Down
4 changes: 4 additions & 0 deletions Tests/AsBuiltReport.Chart.Functions.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Describe 'AsBuiltReport.Chart Exported Functions' {
It 'Should throw error for mismatched Values and Labels' {
{ New-PieChart -Title 'Test' -Values @(1, 2) -Labels @('A') -Format 'png' -OutputFolderPath $TestDrive } | Should -Throw -ExpectedMessage "Error: Values and labels must be equal."
}
It 'Should throw when OutputFolderPath does not exist' {
$missingPath = Join-Path -Path $TestDrive -ChildPath 'missing-folder'
{ New-PieChart -Title 'Test' -Values @(1, 2) -Labels @('A', 'B') -Format 'png' -OutputFolderPath $missingPath } | Should -Throw
}
}

Context 'New-DonutChart' {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Invoke-Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if ($PSVersion.Major -lt 7) {
Write-Host "`nInstalling required modules..." -ForegroundColor Yellow

$RequiredModules = @(
@{ Name = 'Pester'; MinimumVersion = '5.0.0' }
@{ Name = 'Pester'; MinimumVersion = '6.2.0' }
)

foreach ($Module in $RequiredModules) {
Expand All @@ -75,7 +75,7 @@ foreach ($Module in $RequiredModules) {
}

# Import Pester
Import-Module Pester -MinimumVersion 5.0.0 -Force
Import-Module Pester -MinimumVersion 6.2.0 -Force

# Configure Pester
$PesterConfiguration = New-PesterConfiguration
Expand Down
2 changes: 1 addition & 1 deletion Todo.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- [] Add support for ScottPlot 5.1.59
- [Done] Add support for ScottPlot 5.1.59
Loading